Does 5% stay 5%? Three calibration workflows
The reference's three statistical workflows, failures kept. Fitted normals, ignored pairings, sparse tables and many tests at once each move a test away from 5%, and a simulation shows how far.
What runs in CodeSplash
- EVA054Paired randomization and permutation tests Runs in CodeSplash
- EVA055Holm and Benjamini–Hochberg multiplicity procedures Runs in CodeSplash
You will be able to
- Explain why plugging fitted parameters into a fixed-null test breaks its size
- Say what a sign-flip test assumes about paired differences
- Predict how a discrete exact test behaves in a sparse table
- Match an adjustment to the error rate it controls under dependence
Read first
Failures kept on purpose
ReadEach workflow asks one question: when the null is true, does a test reject about 5% of the time? Each was built so that something goes wrong, and the reference keeps those results in the record instead of trimming them. A procedure that fails under a known mechanism is a lesson about the mechanism.
The four studies below are templates in the Academy's Simulation Lab, all named "Does 5% stay 5%?". Run each, then change one setting and predict what moves.
Workflow 1: a fitted normal
PredictPredict first
You estimate a sample's mean and SD, then run a Kolmogorov–Smirnov test against a normal with exactly those values, using the ordinary KS table. The data really are normal. How often does it reject at 5%?
Reveal
Well below 5%. The fitted normal was chosen to match the sample, so the sample looks closer to it than to a normal fixed in advance. The ordinary table is for a fixed null. LillieforsLilliefors testKolmogorov–Smirnov test for normality when the mean and SD come from the data, with p-values corrected for that.' idea fixes it: refit the mean and SD in every simulated sample too, so the reference distribution includes the fitting.
The template compares three procedures: KS against a fixed N(0, 1), KS on the fitted mean and SD with the fixed table (invalid), and the refitted Monte Carlo KS.
Workflow 2: pairing and symmetry
ExploreWith ten pairs, the template compares a paired t test, an exact sign-flip testSign-flip testFlips the signs of paired differences in every possible way; exact when the differences are symmetric about zero. on the differences and Welch's t test that ignores the pairing.
BExplorable · Flipping signs in paired data
How do you build a null distribution when each subject is their own control?
Which analysis gives the smaller p-value?
Under the null, "after" and "before" are interchangeable within a pair, so each difference could have had either sign. There are 1024 equally likely arrangements.
Commit your prediction above to see the result
Make your prediction to see the result.
Ignoring a positive correlation between the two measurements wastes power; ignoring a negative one makes the test reject a true null too often. The sign-flip test is exact when the differences are symmetric about zero under the null. With skewed differences whose mean is zero, flipping signs creates arrangements that the null doesn't actually imply, and its size drifts.
Workflow 3: sparse tables
ReadTen people in one group, thirty in the other, and a rare outcome. The template runs Pearson's χ² without correction, Fisher's exact testFisher's exact testFixes both margins of a 2 × 2 table and adds up hypergeometric probabilities of tables as extreme as yours. and a Newcombe–Wilson intervalNewcombe–Wilson intervalAn interval for a difference of two proportions built from each group's Wilson interval; it behaves well in sparse tables. for the risk difference.
Exact doesn't mean "rejects exactly 5%". Fisher's test conditions on the margins, so its p-values take only a few values, and the nearest one below 5% may be far below. It rejects less often than α: conservative, with lost power. The χ² approximation can stray in either direction when expected counts are small. Read the interval's coverage too, not only the tests' rejection rates.
Workflow 4: many tests at once
ExploreThirty tests, with or without a handful of real effects, independent or correlated. The template compares no adjustment, Bonferroni, Holm, Benjamini–Hochberg and Benjamini–Yekutieli.
BExplorable · The family-wise error rate
If you run many tests, how likely is at least one false alarm, and what does correcting cost?
Without correction, how often does this family produce at least one false alarm?
Commit your prediction above to see the result
Make your prediction to see the result.
Bonferroni and Holm control the familywise error rateFamily-wise error rateThe chance of at least one false positive across a family of tests. under any dependence; Holm never rejects less. Benjamini–Hochberg controls the false discovery rateFalse discovery rateThe expected share of false positives among the results you call significant. under independence or positive dependence; Benjamini–Yekutieli pays a log factor to hold under any dependence. No adjustment lets the chance of at least one false alarm climb toward certainty.
Run the four templates
In the appIn the Simulation Lab, the rail lists "Does 5% stay 5%? Fitted normality", "… Pairing", "… Sparse tables" and "… Testing families". Each opens with its scenarios as a factor, so one run fills the whole table: rejection rates with Wilson intervals, coverage for interval procedures, and power cells grayed out where the matching null scenario fails.
Raise the replicates before you trust a small difference between two rates, and save a study as a .cssim file to share the exact design.
Check: the three workflows
CheckpointCheck yourself
Why does a KS test against a normal fitted to the same sample reject less often than α when the data are normal?
Show the answer
Answer: a
Fitting moves the null toward the data. Refitting in every simulated sample (Lilliefors) builds that into the reference distribution.
Check yourself
What does an exact sign-flip test on paired differences assume under the null?
Show the answer
Answer: b
Flipping a difference's sign must give an equally likely dataset. Skewed differences with mean zero break that, even though the mean is right.
Check yourself
Pairs are negatively correlated and you analyze them with Welch's t test, ignoring the pairing. What happens under a true null?
Show the answer
Answer: b
With negative correlation, the variance of the differences exceeds the sum Welch's test assumes, so its statistic is too large.
Check yourself
In a sparse table with no real difference, Fisher's exact test rejects 2% of simulated datasets at α = 5%. Is the test broken?
Show the answer
Answer: b
Conditioning on the margins leaves few possible tables. Exact means the stated level is never exceeded, not that it is hit.
Check yourself
Thirty strongly correlated tests, and you need false discovery rate control that holds under any dependence. Which adjustment?
Show the answer
Answer: b
Standard BH needs independence or positive dependence. BY adds a log factor and holds under arbitrary dependence, at a cost in power.
Check yourself
Thirty independent true nulls, each tested at 5% with no adjustment. What is the chance of at least one false alarm? Three decimals.
Show the answer
Answer: 0.785
. Without an adjustment, a false alarm is more likely than not.
Recap
Recap- Fitting parameters before a fixed-null test changes the null; refit inside the reference (Lilliefors).
- Sign-flip tests need symmetric differences; ignoring a negative pairing inflates size.
- Exact tests in sparse tables are conservative because their p-values are discrete.
- Holm and Bonferroni hold the familywise rate under any dependence; BH needs independence or positive dependence; BY holds always.
- The Simulation Lab's four "Does 5% stay 5%?" templates keep each failure visible.
Concepts in this lesson