Skip to content

Does 5% stay 5%?

When you plug in estimates, ignore pairing, or test sparse tables and many hypotheses, does a 5% test still reject 5% of true nulls?

Capstone 18~45 minapplied Student's sleep data (10 patients, two drugs)

The story

A clinic compares two sleep drugs in ten patients who each took both, and plans a lot of follow-up tests. The analyst's habits are common ones: check normality with a Kolmogorov–Smirnov test using the sample's own mean and SD, compare the drugs with whatever t test the software offers first, use Pearson's χ² on small tables, and report every p below 0.05.

Each habit makes a promise about error rates that holds only in some situations. You'll run the analysis in Analyze on Student's own sleep data, then put each promise on trial in the Simulation Lab, where the truth is known because you set it. Some procedures will fail their trial: an invalid test that rejects far less often than it says, a test that ignores the pairing, a family of tests that finds something by chance. Those failures are the point.

Data: Student's sleep data (10 patients, two drugs) · R-datasets. Cushny AR, Peebles AR (1905); Student (1908). The probable error of a mean. Biometrika 6:1–25. R datasets::sleep, reshaped wide by patient.

Stage 1 · analyze · ~8 min

Check normality the usual way

Run the normality battery on the first drug's sleep gains. Among its tests, Lilliefors' version of the Kolmogorov–Smirnov test estimates the mean and SD from the sample, as the analyst's habit does, and adjusts its reference distribution for that.

Why does a test that plugs in the sample's mean and SD need a different reference distribution?

  1. Open Normality tests (battery) in Analyze on sleep (sample).
  2. Set Variable to drug1 and press Run.
  3. Find the Lilliefors result among the tests. It uses the sample's own mean and SD.Fitting the mean and SD to the sample pulls the fitted curve toward the data, so the plain KS table would make departures look smaller than they are.

Stage 2 · academy · ~13 min

Does the fitted-normality KS keep 5%?

In the Simulation Lab, run the template that draws thousands of normal samples and applies three versions of the KS test: against a fixed N(0, 1), with the sample's mean and SD plugged into the plain table, and refitted in every simulated sample.

Which version rejects about 5% of normal samples, and what does the plugged-in version do?

  1. Open Academy.
  2. Open Simulation Lab in the Academy rail.
  3. Open the template Does 5% stay 5%? Fitted normality.
  4. Press Run and wait for every replicate.
  5. Compare the three rejection rates for normal samples. Which one is far below 5%?The plugged-in KS test rejects far fewer normal samples than its 5% label says, so it also misses real departures. Lilliefors' refitting restores the promise.

Stage 3 · analyze · ~8 min

Respect the pairing

Every patient took both drugs, so the comparison is within patients. Run the paired t test, then add the exact sign-flip p-value, which needs only symmetric differences, not normal ones.

What does the sign-flip p-value assume, and how does it compare with the t test's?

  1. Open Paired t-test in Analyze on sleep (sample).
  2. Set First measurement to drug1 and Second measurement to drug2, set Randomization p-value to Sign-flip test, and press Run.
  3. Compare the t test's p-value with the sign-flip p-value.

Stage 4 · academy · ~8 min

What ignoring the pairs does

Back in the Simulation Lab, run the pairing template: ten pairs, positively or negatively correlated, with symmetric or skewed differences, tested by the paired t, the sign flip and a Welch test that ignores the pairing.

Which test's error rate moves away from 5% when the pairs are correlated, and in which direction?

  1. Open the template Does 5% stay 5%? Pairing.
  2. Press Run and wait for every replicate.
  3. Read the null rows. Where does Welch's test ignoring the pairing reject too rarely, and where too often?Treating paired columns as independent groups uses the wrong variance for the difference, so its error rate depends on a correlation the test never looks at.

Stage 5 · academy · ~8 min

Sparse tables and many tests

Run two more templates: small 2 × 2 tables with a rare outcome, where Pearson's χ² and Fisher's exact test make different promises, and thirty tests at once, where an unadjusted 5% per test finds something almost every time.

Which procedures keep their stated error rate in each template, and which fail it?

  1. Open the template Does 5% stay 5%? Sparse tables and press Run.
  2. Now open Does 5% stay 5%? Testing families and press Run.
  3. In the all-null rows, how often does at least one unadjusted test reject?A 5% promise is per test. A family of tests needs an adjustment that makes the promise for the family, familywise error or false discovery rate.
Hints
  • A test's 5% is a promise about repeated use in one situation; the Simulation Lab checks it by repeating.
  • Plugging estimates into a test's table, ignoring pairing and testing many things each change the situation.
  • Keep the failing procedures in the report; they show which promises your analysis can rely on.

report

Which promises hold for this analysis

Write a short methods review for the clinic: for each habit (normality check, drug comparison, small tables, many tests) say what the simulation showed, which procedure you'd use instead, and why.

  1. Checking normality
  2. Comparing the drugs
  3. Small tables
  4. Many tests
  5. What we keep and why
Rubric
CriterionPoints
Explains that the plugged-in KS test rejects far less than 5% and that Lilliefors refits.2
Uses a paired analysis and explains how ignoring the pairing changes the error rate.2
Reports the sign-flip p-value and its symmetry assumption.1
Describes Pearson's and Fisher's behavior with small expected counts.1
Shows the unadjusted familywise error is far above 5% and names an adjustment.2
Keeps the failing procedures in the report as evidence.1

Model answer

Show the model answer

Checking normality. A Kolmogorov–Smirnov test that plugs in the sample's own mean and SD but uses the table for a fixed normal rejects far fewer normal samples than its 5% label, which also means it misses real departures. Refitting the mean and SD in every simulated sample, Lilliefors' idea, brings the rate back to about 5%. Use the Lilliefors result from the battery, or a Shapiro–Wilk test.

Comparing the drugs. Each patient took both drugs, so analyze the ten differences: the paired t test, with the exact sign-flip p-value as a check that needs only symmetric differences. In the simulation, a Welch test that ignores the pairing rejects too rarely when the pairs are positively correlated and too often when they are negatively correlated: its error rate depends on a correlation it never looks at.

Small tables. With small expected counts, Pearson's χ² approximation can stray from 5%, while Fisher's exact test stays at or below 5% because its p-values move in discrete steps; report Fisher's test and an interval for the difference.

Many tests. With thirty tests at 5% and no real effects, at least one unadjusted test rejects in most simulated studies. Holm's procedure keeps the familywise error at 5%; Benjamini–Hochberg controls the false discovery rate when some effects are real.

What we keep and why. The failing procedures stay in the report: they show which promises this analysis can and can't rely on, read from Monte Carlo rates with their intervals.