Discovery Lab — Statistical Assumptions
By the end of this module, you will be able to:
shapiro.test() result for a variable in RHere's a mystery:
Two researchers measure reaction times. Same task, same question, same sample size.
Researcher B shows their histogram to a labmate, who says: "You can't run a t-test on that. Your data aren't normal. Your p-values will be garbage."
Your job: Find out whether the labmate is right. Not by arguing about it — by measuring it.
Before any statistics, look at the data. Click below to generate one sample from each researcher's population and compare them.
Important: both populations have the same mean (400 ms) and the same standard deviation (50 ms). The only difference between them is shape.
Question 1: Describe the shape of each distribution. In the Q-Q plots, where do B's points pull away from the diagonal line?
Question 2: Look at the mean and median for each sample in the output box. For which researcher are they far apart, and which direction is the mean pulled? Why does skew do that?
Do this before you run anything else. Write it down, out loud, with your partner. You will come back to this prediction at the end, and being wrong here is not a problem — it is the point of the exercise.
Suppose the null hypothesis is true: there is genuinely no difference between two groups. We run a t-test at α = .05 over and over, on fresh samples each time. We should get a "significant" result about 5% of the time — those are our false positives.
Now: what happens if we do that with Researcher B's skewed data, 25 per group?
Why do you predict that? (2–3 sentences, both partners agree)
The comparison above is a demonstration. These are the tools you will actually use — the same
hist(), qqnorm(), and shapiro.test() from Chapter 11.
Run this in Posit Cloud.
Build both researchers' data. rnorm() draws from a normal population;
rexp() draws from a right-skewed one. The 350 + shifts B's distribution
so both populations have a mean of 400 ms and an SD of 50 ms.
Chapter 11's rule of thumb is |skew| < 0.5 → symmetric. A is at 0.04. B is at 2.54 — five times over the line. And Shapiro-Wilk agrees emphatically: B's p is 0.0000003.
So B's data really are badly non-normal. This is not a borderline case or a large-n artifact. Whatever we find next, we cannot escape it by claiming the data were fine all along.
Question 3: Report both Shapiro-Wilk results and both skewness values. Using Chapter 11's thresholds, what is the verdict on each dataset?
B wasn't collecting reaction times for fun. They ran a real study: does a training program make people faster? Here is their data and their test.
Note that R used Welch's t-test. That is R's default, and Chapter 15 says to keep it that way. Remember this — it matters in Part 8.
Question 4: Report the effect size and interpret the confidence interval for the mean difference in milliseconds. What range of true training effects is consistent with this data? Do not answer "it doesn't contain zero" — say what the interval means for someone deciding whether to adopt this training program.
Question 5: This is an observational comparison, not a randomized experiment. Name one confound or third variable that could produce a 51 ms difference between these groups even if the training program does nothing at all.
Now we answer your Part 2 prediction directly. We will build both populations, draw two samples where we know there is no real difference, run a t-test, and repeat 5,000 times — counting how often we get a false positive.
If the labmate is right, the skewed population should produce far more than 5%.
This takes a few seconds to run — it is fitting 10,000 t-tests. Simulated rates wobble by about ±0.6 percentage points from run to run, so read these as "about 5%," not as exact values.
The labmate was wrong. The badly skewed population — skewness 2.5, Shapiro-Wilk p = 0.0000003 — produced false positives 5.06% of the time. The nicely normal one produced 4.58%. Both are sitting on the nominal 5%. The skewed one is, if anything, marginally the better behaved of the two.
Skew did not inflate the error rate. It did essentially nothing.
Question 6: Go back and read your Part 2 prediction. Was it right? Write down what you expected, what actually happened, and what you think explains the gap.
Reasonable follow-up: maybe skew doesn't cause false alarms, but maybe it makes you miss real effects. Let's put a real 40 ms effect into both populations and see how often each researcher detects it.
Both comparisons are a 40 ms shift against an SD of 50, so both have the same effect size, Cohen's d = 0.8. The only difference is shape.
79% versus 81%. No meaningful power cost either. At equal sample sizes, the skewed researcher is not being punished on either error type.
Question 7: Record both power values. If skew cost you no false positives and no power, what exactly was the labmate worried about? Is there any version of their concern that still makes sense?
Chapter 10 gives the reason, and you can watch it happen. The t-test does not care about the shape of your data. It cares about the shape of the sampling distribution of the mean. Those are different things, and the second one is much better behaved.
| What we measured | Skewness | Chapter 11 verdict (|skew| < 0.5) |
|---|---|---|
| The raw data | 2.07 | Badly skewed |
| Means of samples of 5 | 0.83 | Still skewed |
| Means of samples of 25 | 0.35 | Symmetric |
The raw data never become normal — they are what they are. But by n = 25, the averages have crossed the book's own symmetry threshold. The t-test works with averages. That is why it was fine.
Question 8: In your own words, explain to a classmate why a histogram of raw data being skewed does not automatically break a t-test. Use the three skewness values above as your evidence.
None of this means assumptions don't matter. It means skew alone, with balanced groups, is not the threat people treat it as. Here is what actually breaks the test. Run each line and record the false positive rate — remember, every one of these should be 5%.
Question 9: Record your five false positive rates. (Enter as decimals, e.g. 0.051.)
| # | Condition | Should be | Your rate |
|---|---|---|---|
| 1 | Skewed, balanced, n = 25 each | .05 | |
| 2 | Skewed, tiny groups, n = 6 each | .05 | |
| 3 | Skewed, unbalanced, 10 vs 40 | .05 | |
| 4 | Unbalanced + unequal spread (Welch) | .05 | |
| 5 | Same as #4, but var.equal = TRUE | .05 |
Read the escalation. Skew on its own: harmless. Skew with tiny groups: the test becomes over-cautious (2.8% — you lose power without gaining accuracy). Skew with unbalanced groups: 7.4%, now genuinely inflated. Add unequal spread: 9.9%, about double what you signed up for.
And then look at #5. Same data as #4. The only change is that we overrode R's default and forced Student's t-test. The false positive rate goes to 25% — one in four "significant" findings would be pure noise.
That last one is not something the data did to you. It is something you did. R defends you from it automatically, and Chapter 15 tells you to leave that defense on.
Question 10: Which condition did the most damage, and what does that tell you about where the real risk lives — in the shape of your data, or in the design of your study and the options you pass to your test?
Question 11: Row 5 differs from row 4 by one argument. Explain what
var.equal = TRUE changes, and why R's default is the safer choice.
Question 12: You're reviewing a manuscript for a journal. The Methods section says:
"We compared anxiety scores between the treatment group (n = 12) and control group (n = 58) using an independent samples t-test with equal variances assumed (α = .05). The treatment group showed significantly lower anxiety (p = .042). Anxiety scores were positively skewed."
Part A: Based on Part 8, list the specific features of this study that should worry you — and say which one worries you least.
Part B: They report p = .042, just under the threshold. Given what you measured in Part 8, roughly how much confidence does that p-value deserve here? Explain using a number from your table.
Part C: As the reviewer, what would you ask the authors to do? Be specific about the analysis, and about what they should report alongside the p-value.
Question 13: THE BIG IDEA
Complete this sentence with your partner (3–4 sentences total):
"Checking normality before running a parametric test matters because…"
Question 14: A classmate who skipped today's lab tells you: "My data failed Shapiro-Wilk, so I have to use a non-parametric test." Write your reply. What would you need to know about their study before agreeing or disagreeing?
Question 15: METACOGNITIVE REFLECTION
You made a prediction in Part 2 and then measured the answer. What did you believe about normality before today that you no longer believe? What will you actually check, in order, the next time you have skewed data?
var.equal = TRUE: 25% false positives. The biggest risk was a choice we made, not a property of the data.Chapter 10 lists three responses to non-normality: rely on robustness, transform, or go non-parametric. Today you measured exactly how much robustness you actually have — and it is more than most people assume. Module 2 trains your eye to read Q-Q plots. Module 3 takes on the opposite failure: what happens when Shapiro-Wilk flags data that are perfectly fine.
One caveat worth carrying forward: this module asked whether the test still works on skewed data. It does. A separate question — taken up in Chapter 13 — is whether the mean is the right thing to compare when a distribution has a long tail. A test can be perfectly valid and still be answering a question you did not want to ask.
Grading: Credit/no-credit, not scored for correctness — but credit requires a genuine attempt; blank or clearly-unattempted answers earn no credit. Work through it with your partner and say what you actually think; a wrong idea you reasoned your way to is worth more here than a right one you copied. This module is built so that a confident wrong prediction in Part 2 is the most useful thing you can do.
module1_lastname1_lastname2.pdf๐ You've completed Module 1! ๐
You tested a widely-believed claim and found it didn't hold. That's the job.