Check normality and outliers
Test normality with Shapiro-Wilk and Q-Q plots, screen for univariate and multivariate outliers, and decide what to do about them.
Parametric tests such as t-tests, ANOVA and regression assume, among other things, that the outcome (or the model residuals) is approximately normally distributed and that no single case dominates the result. This lesson shows how to check both, and, just as important, how to avoid overreacting to the checks.
Which variable should be normal?
A common misunderstanding is that every variable must be normal. In fact:
- for a t-test or ANOVA, the outcome should be roughly normal within each group;
- for regression, the residuals should be roughly normal, not the predictors;
- for correlation, both variables should be roughly normal if you want a Pearson test.
And with larger samples, the central limit theorem makes these tests robust: the sampling distribution of the mean is close to normal even when the data are not. With 30 or more per group, moderate non-normality rarely matters; strong skew with outliers still can.
The Shapiro-Wilk test and the Q-Q plot
Test normality of the final exam score
- Shapiro-Wilk W = .996, p = .785: no evidence of non-normality.
- Look at the Q-Q plot: the points follow the diagonal.
- Now choose StudyHours as the variable: W = .875, p < .001, and the Q-Q plot bends upward at the right end.
The final exam score passes easily: W = .996, p = .785. StudyHours fails clearly: W = .875, p < .001, with skewness 1.66 (z = 10.5). The Q-Q plot shows the shape of the problem: points follow the line in the middle but curve upward at the right, the signature of a long right tail.
Now check Stress separately for female and male students by choosing Gender as the grouping variable. Both groups give significant results (female W = .970, p = .005; male W = .972, p = .023), yet the skewness values are small (−0.52 and 0.22). This is the classic large-sample trap: with more than 100 cases per group, Shapiro-Wilk detects deviations far too small to matter. Use the test together with the Q-Q plot, the histogram and the skewness and kurtosis values, and give the most weight to how the distribution looks. Stress is fine for a t-test; StudyHours, with its long tail, is better analysed with a non-parametric test or a robust check.
Outliers
An outlier is a value far from the rest. It can be an error (which you fix during cleaning) or a genuine but unusual case. Outliers matter because means, SDs, correlations and regression slopes can all be pulled by a single extreme value.
Screen for outliers
- Variables: StudyHours, SleepHours and Final, with ID as the case label.
- Two values exceed |z| = 3.29 (S168 with 51 hours and S224 with 53 hours).
- The same two students are the only multivariate outliers (Mahalanobis D² above 16.27).
The outlier calculator applies several rules at once:
- |z| > 3.29 (p < .001, two-tailed), the cut-off recommended by Tabachnick and Fidell. Two students exceed it on StudyHours: S168 (51 hours, z = 4.82) and S224 (53 hours, z = 5.08).
- Tukey’s IQR fences (Q1 − 1.5 × IQR and Q3 + 1.5 × IQR), the rule behind box plots. It flags nine StudyHours values above 30.5 hours and five SleepHours values. The IQR rule flags more values in skewed variables.
- Grubbs’ test checks whether the single most extreme value is an outlier under normality. It is significant for StudyHours (G = 5.08, p < .001) but not for SleepHours or Final.
- Mahalanobis distance finds cases with an unusual combination of values across several variables. Again only S168 and S224 exceed the critical value (D² = 26.1, critical χ²(3) = 16.27).
What to do with outliers
First, check for errors: is 53 hours a typo for 5 or 35? If the original source confirms the value, it is real. Then choose and report a rule. Options include keeping the cases and using a method that is robust to them (non-parametric tests, robust standard errors), running the analysis with and without them as a sensitivity analysis, or winsorising (replacing extreme values with the value at a chosen percentile). Deleting genuine cases simply because they are inconvenient is not acceptable. In this course, the two hard-working students are kept, and in Lesson 9 you will see that the regression conclusions do not change without them.
Other assumptions
Normality is not the only assumption. Independence of observations (each student answers once) is guaranteed by the design, not a test. Homogeneity of variance between groups is checked with Levene’s test, which the t-test and ANOVA tools report automatically (Lessons 6 and 7). Linearity and homoscedasticity in regression are checked with the residual plot (Lesson 9).
Reporting
Normality was assessed with Shapiro-Wilk tests, Q-Q plots and skewness and kurtosis values. Final exam scores were approximately normal, W(240) = .996, p = .785. Weekly study hours were positively skewed (skewness = 1.66), so analyses of study hours used non-parametric tests. Two cases were univariate and multivariate outliers on study hours (|z| > 3.29; Mahalanobis D², p < .001); they were verified as genuine and retained, and excluding them did not change the conclusions.
Key takeaways
- Check normality of the outcome within groups, or of the residuals in regression, not of every variable.
- With large samples Shapiro-Wilk flags trivial deviations; judge with Q-Q plots, histograms and skewness.
- Use several outlier rules, check flagged cases for errors and decide with a stated rule.
- Report what you checked, what you found and what you did.
Check your understanding
Answer each question to see the explanation. Finishing the quiz marks this lesson as complete.