Module 1: Why Does Normality Matter?

Discovery Lab — Statistical Assumptions

โ˜๏ธ Working Guidelines

0% Complete

๐ŸŽฏ Learning Objectives

By the end of this module, you will be able to:

  1. Produce a histogram, Q-Q plot, and shapiro.test() result for a variable in R
  2. Compute how often a t-test gives a false positive, by simulation
  3. Predict whether skewed data will break a t-test — and check your prediction against evidence
  4. Identify the three conditions under which non-normality genuinely damages a t-test
  5. Justify a decision to proceed with, or abandon, a parametric test for a given dataset

๐Ÿ” The Puzzle

Here'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.

Part 1: Look at the Two Datasets

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?

Part 2: ๐Ÿ”ฎ Commit to a Prediction

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)

Part 3: Now Do It in R

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.

set.seed(13) a_rt <- rnorm(40, mean = 400, sd = 50) # Researcher A: symmetric b_rt <- 350 + rexp(40, rate = 1/50) # Researcher B: right-skewed par(mfrow = c(2, 2)) hist(a_rt, col = "lightblue", main = "A: symmetric", xlab = "RT (ms)") qqnorm(a_rt, main = "A: Q-Q plot"); qqline(a_rt, col = "red") hist(b_rt, col = "salmon", main = "B: right-skewed", xlab = "RT (ms)") qqnorm(b_rt, main = "B: Q-Q plot"); qqline(b_rt, col = "red") par(mfrow = c(1, 1)) # reset the plot grid shapiro.test(a_rt) shapiro.test(b_rt) library(e1071) skewness(a_rt) skewness(b_rt)
Check your output — open this after you have run the code yourself

What R actually returns

Shapiro-Wilk normality test data: a_rt W = 0.99007, p-value = 0.9755 Shapiro-Wilk normality test data: b_rt W = 0.73226, p-value = 3.437e-07 > skewness(a_rt) [1] 0.04341624 > skewness(b_rt) [1] 2.5382

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?

Part 4: Researcher B's Actual Study

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.

set.seed(13) b_control <- 350 + rexp(30, rate = 1/50) # untrained, mean 400 ms b_treatment <- 310 + rexp(30, rate = 1/50) # trained, mean 360 ms t.test(b_treatment, b_control) library(effsize) cohen.d(b_treatment, b_control)
Check your output
Welch Two Sample t-test data: b_treatment and b_control t = -4.5832, df = 46.553, p-value = 3.441e-05 alternative hypothesis: true difference in means is not equal to 0 95 percent confidence interval: -73.83097 -28.77968 sample estimates: mean of x mean of y 345.6538 396.9591 Cohen's d d estimate: -1.183373 (large) 95 percent confidence interval: lower upper -1.7436271 -0.6231198

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.

Part 5: The Test That Settles It

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%.

normal_pop <- function(n) rnorm(n, mean = 400, sd = 50) skewed_pop <- function(n) 350 + rexp(n, rate = 1/50) false_positive_rate <- function(pop, n1, n2, reps = 5000) { mean(replicate(reps, t.test(pop(n1), pop(n2))$p.value < .05)) } set.seed(13) false_positive_rate(normal_pop, 25, 25) set.seed(13) false_positive_rate(skewed_pop, 25, 25)

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.

Check your output — open this after you have made your prediction and run the code
> set.seed(13) > false_positive_rate(normal_pop, 25, 25) [1] 0.0458 > set.seed(13) > false_positive_rate(skewed_pop, 25, 25) [1] 0.0506

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.

Part 6: But Surely the Power Suffers?

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.

normal_treat <- function(n) rnorm(n, mean = 360, sd = 50) skewed_treat <- function(n) 310 + rexp(n, rate = 1/50) power_rate <- function(pop_c, pop_t, n, reps = 5000) { mean(replicate(reps, t.test(pop_t(n), pop_c(n))$p.value < .05)) } set.seed(13) power_rate(normal_pop, normal_treat, 25) set.seed(13) power_rate(skewed_pop, skewed_treat, 25)

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.

Check your output
> set.seed(13) > power_rate(normal_pop, normal_treat, 25) [1] 0.7926 > set.seed(13) > power_rate(skewed_pop, skewed_treat, 25) [1] 0.8062

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?

Part 7: Why? Watch the Central Limit Theorem Work

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.

set.seed(13) means_of_5 <- replicate(5000, mean(skewed_pop(5))) means_of_25 <- replicate(5000, mean(skewed_pop(25))) set.seed(13) raw <- skewed_pop(5000) par(mfrow = c(1, 3)) hist(raw, col = "salmon", main = "Raw skewed data", xlab = "RT (ms)") hist(means_of_5, col = "lightblue", main = "Means of n = 5", xlab = "Sample mean") hist(means_of_25, col = "lightgreen", main = "Means of n = 25", xlab = "Sample mean") par(mfrow = c(1, 1)) skewness(raw) skewness(means_of_5) skewness(means_of_25)
Check your output
> skewness(raw) [1] 2.071885 > skewness(means_of_5) [1] 0.8284256 > skewness(means_of_25) [1] 0.3514625
What we measuredSkewnessChapter 11 verdict (|skew| < 0.5)
The raw data2.07Badly skewed
Means of samples of 50.83Still skewed
Means of samples of 250.35Symmetric

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.

Part 8: So When Does It Bite?

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%.

# a population that is skewed AND lets us set the spread skewed_sd <- function(n, s) 400 - s + rexp(n, rate = 1/s) set.seed(13) # 1. balanced groups (our baseline) false_positive_rate(skewed_pop, 25, 25) set.seed(13) # 2. very small groups false_positive_rate(skewed_pop, 6, 6) set.seed(13) # 3. badly unbalanced groups false_positive_rate(skewed_pop, 10, 40) set.seed(13) # 4. unbalanced AND unequal spread mean(replicate(5000, t.test(skewed_sd(10, 80), skewed_sd(40, 30))$p.value < .05)) set.seed(13) # 5. the same as #4, but overriding R's default mean(replicate(5000, t.test(skewed_sd(10, 80), skewed_sd(40, 30), var.equal = TRUE)$p.value < .05))

Question 9: Record your five false positive rates. (Enter as decimals, e.g. 0.051.)

#ConditionShould beYour rate
1Skewed, balanced, n = 25 each.05
2Skewed, tiny groups, n = 6 each.05
3Skewed, unbalanced, 10 vs 40.05
4Unbalanced + unequal spread (Welch).05
5Same as #4, but var.equal = TRUE.05
Check your output — open this after filling in your table
[1] 0.0506 # 1. balanced [1] 0.0278 # 2. tiny groups [1] 0.0744 # 3. unbalanced [1] 0.0994 # 4. unbalanced + unequal spread [1] 0.2502 # 5. same, but var.equal = TRUE

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.

Part 9: Real-World Application

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.

Part 10: Synthesis & Reflection

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?

๐ŸŽฏ Key Discoveries

What We Discovered Today:

๐Ÿ“Œ Where this goes next

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.

๐Ÿ“‹ Before You Submit

โœ… Submission Checklist

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.

๐Ÿ“ค How to Submit

  1. Click "Save Progress" to ensure everything is stored
  2. Use your browser's Print function: Ctrl+P (Windows) or Cmd+P (Mac)
  3. Choose "Save as PDF" as the destination
  4. Save as: module1_lastname1_lastname2.pdf
  5. Upload the PDF to your course management system

๐ŸŽ‰ You've completed Module 1! ๐ŸŽ‰

You tested a widely-believed claim and found it didn't hold. That's the job.