When Transformation Isn't the Answer
By the end of this module, you will:
wilcox.test() and kruskal.test() in R and read their outputParametric tests (t-test, ANOVA) make assumptions:
Non-parametric tests are "assumption-free":
The Trade-off:
Non-parametric tests are said to be about 95% as powerful as parametric tests when the data really are normal, but more powerful when the data are skewed or carry outliers. You do not have to take that on faith — in Part 8 you will measure both halves of it yourself.
| Research Question | Parametric Test | Non-Parametric Alternative |
|---|---|---|
| Compare 2 independent groups | Independent t-test | Mann-Whitney U test (also called Wilcoxon rank-sum) |
| Compare 2 paired/matched samples | Paired t-test | Wilcoxon signed-rank test |
| Compare 3+ independent groups | One-way ANOVA | Kruskal-Wallis test |
| Compare 3+ related groups | Repeated-measures ANOVA | Friedman test |
| Correlation between 2 variables | Pearson's r | Spearman's rho (ฯ) |
Non-parametric tests convert your data to ranks before analysis:
Example:
Original data: 50, 80, 85, 200, 220
Ranks: 1, 2, 3, 4, 5
Why this matters:
What are you testing?
Non-parametric tests ask: "Do the distributions differ?" rather than "Do the means differ?"
Do this before you run anything. In Part 4 you will analyse two datasets, each with a t-test and a Mann-Whitney test.
Predict: on which dataset, if either, will the two tests disagree with each other?
And a harder one: if they disagree, can the direction of the difference change too — not just whether it is significant? Write your prediction.
When assumptions are met, both tests should tell the same story.
exact = FALSE tells R to use the asymptotic
approximation rather than the exact p-value — Chapter 13's default, and what you
want once there are tied ranks.
Both significant, same direction, same conclusion. The t-test's p is a little smaller — that is the ~5% efficiency cost of ranking, and it is the whole cost when the data are well behaved.
Everyone in the treatment condition responded faster, except three people who were dramatically slower than anyone else.
Question 1: Before opening the reveal — run the four descriptive lines and record them. Which group has the higher mean? Which has the higher median?
Control: mean
median
Treatment: mean
median
Look at what just happened. The treatment group's mean is higher (252 vs 231) while its median is lower (172 vs 219). The two summaries point in opposite directions.
The t-test, which works on means, reports p = .62 — no evidence of any difference at all. The Mann-Whitney test, which works on ranks, reports p = .0000008.
Three participants did that. Their reaction times (820, 910, 1040 ms) are so far from everything else that they drag the treatment mean up past the control mean and inflate the variance enough to flatten the t-test. In the ranking, each of them is worth exactly one rank — the three highest — and the other 27 treatment participants still sit below almost every control participant.
Question 2: Was your Part 3 prediction right? Say what you predicted and what actually happened.
Question 3: On Dataset B the mean and the median disagree about which group is faster. Which one answers the question "did the treatment help a typical participant?" — and why?
Question 4: A colleague says "the t-test found nothing, so there is nothing there." Using Dataset B, explain in your own words why that reasoning fails.
Question 5: Dataset A showed the t-test with the slightly smaller p-value. Given that, why not just use Mann-Whitney for everything and never worry about normality again?
A p-value tells you the difference is probably not zero. It does not tell you how big it is. Report an effect size every time, significant or not.
This course's convention is Rosenthal's r.
wilcox_effsize() returns r = Z / √N, which is
0.637 here. A different rank-based measure, the rank-biserial
correlation, is 0.742 for the same data. It is legitimate, but it is
not numerically interchangeable with Rosenthal's r. If other software reports it,
name it explicitly; for course work, report the value from wilcox_effsize() as
Rosenthal's r.
This trips up almost everyone the first time.
wilcox.test() labels its statistic W. The APA convention
for a two-group rank-sum test is U. They are the same
number — only the name differs. Report R's value, call it U.
Strictly, a two-group comparison has two U values that sum to n1 × n2. For Dataset B:
Report the one your software gives you (784) and say which test produced it. Do not silently rename the statistic or recompute it — a reader who reruns your analysis needs to land on your number.
Question 6: Write the APA sentence for Dataset B. Include the medians, the statistic with its correct label, the p-value, and the effect size with its name.
Satisfaction ratings on a 1–7 scale across three departments. Ratings are ordinal, so a rank-based test is the right call regardless of what any normality test says.
Kruskal-Wallis is an omnibus test: it says at least one department differs, not which. The pairwise follow-up shows Sales differs from both Billing and Support, while Billing and Support do not differ from each other (p = .17) — which matches the medians (6, 4, 4).
p.adjust.method = "BH" corrects for running three comparisons. Never skip it.
Question 7: The omnibus p is .0000078, but one of the three pairwise comparisons is .17. Explain to a classmate why those are not contradictory.
Back at the top, this module claimed non-parametric tests are ~95% as powerful when data are normal, and more powerful when data are skewed. Test it.
| Data | t-test | Mann-Whitney | Ratio |
|---|---|---|---|
| Normal | 54.9% | 51.8% | 0.94 |
| Skewed | 67.9% | 89.5% | 1.32 |
The claim holds, and you measured it. On normal data the rank test retains 94% of the t-test's power — the textbook figure is 95.5%, and 2,000 simulations will land near it. On skewed data the rank test is 32% more powerful.
So the "cost" of going non-parametric on well-behaved data is about six percentage points of power. The cost of not going non-parametric on badly behaved data was Dataset B.
Question 8: Record the four power values. Given the ratio on normal data, is the "~95% as powerful" claim fair? Given the skewed row, restate the trade-off in one sentence you would actually say out loud.
1. Data are clearly non-normal AND small sample
n < 30 and severe skewness or outliers โ Use non-parametric
2. Data are ordinal
Likert scales (1-5 ratings), rankings โ Non-parametric is appropriate
3. Transformation doesn't work or is too complex
Tried log, sqrt, etc., but still not normal โ Use non-parametric
4. You want robustness
Worried about outliers influencing results โ Non-parametric is more robust
5. Your research question is about distributions, not just means
"Do groups differ?" is broader than "Do means differ?" โ Non-parametric
1. You have large samples (n > 50-100) with mild violations
Parametric tests are robust; transformation may be easier
2. Your field expects parametric tests
Consider using parametric + reporting assumption checks + sensitivity analysis
3. You need specific comparisons (post-hocs)
Parametric post-hoc tests are more developed than non-parametric equivalents
4. Interpretation is important
Means are easier to interpret than "sum of ranks"
Step 1: Check normality
Step 2: Decide based on results + sample size
Step 3: Report clearly
Always report which test you used and why!
Scenario A: You're comparing pain ratings (1-10 scale) between treatment and control groups (n=25 each). Data are skewed right. What do you do?
Scenario B: You have reaction time data (n=80 per group). Right-skewed. Shapiro-Wilk p = 0.001. Q-Q plot shows moderate deviation. What do you do?
Scenario C: Survey with satisfaction ratings (Very Dissatisfied to Very Satisfied, n=200). Compare 3 departments. What test?
Scenario D: Income data from 40 people, comparing two cities. Heavily right-skewed with outliers (a few millionaires). What do you do?
Bad example:
"We used a Mann-Whitney test. p = 0.03."
Good example:
"Data were not normally distributed (Shapiro-Wilk: W = 0.89, p = 0.003) and transformation did not improve normality. We therefore used the Mann-Whitney U test to compare groups. The treatment group (Mdn = 85) scored significantly higher than the control group (Mdn = 72), U = 245, p = .031, r = .34 (Rosenthal's r)."
Note the two details this sentence gets right that most student write-ups miss: the statistic is called U even though R printed W (Part 6), and the effect size is named rather than left as a bare r (Part 5).
Key elements to include:
โ Non-parametric tests are not "inferior"
They're just different! ~95% power when assumptions hold, MORE power when violated.
โ They test distributions, not means
The question changes from "Are means different?" to "Are distributions different?"
โ Use ranks, not raw values
This makes them robust to outliers and skewness.
โ Main alternatives:
โ When to use them:
โ Always report why you chose non-parametric
Document your assumption checking and decision-making process!
You've now completed the entire normality testing curriculum!
Module 1: Why normality matters (Type I error inflation)
Module 2: Visual detection (histograms, Q-Q plots)
Module 3: Statistical tests (Shapiro-Wilk, large sample paradox)
Module 4: Transformations (log, sqrt, when to transform)
Module 5: Non-parametric alternatives (Mann-Whitney, Kruskal-Wallis)
You now have a complete toolkit for handling normality in your research!
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.
module5_lastname1_lastname2.pdf๐ You've completed all 5 modules! ๐
You're now equipped to handle normality testing like a pro!
Next: Apply these skills to your own research data!