Contents
- What does normality mean in regression?
- How to test normality
- A good model with non-normal residuals
- What should be done when residuals are not normal?
- Does normality matter in large samples?
- Which normality check fits which analysis?
- Testing normality in Python
- Frequently asked questions
- What is a normality test?
- Should normality be tested on the data or on the residuals?
- Which is better, Kolmogorov-Smirnov or Shapiro-Wilk?
- Is it acceptable to delete data to achieve normality?
- Does a log transformation always fix non-normality?
- Is a normality test needed for nonparametric tests?
- References
Versi bahasa Indonesia: Uji Normalitas: Tips Mengatasi Data Tidak Normal
Short answer: a normality test checks whether the residuals of a model (or, for some tests, the data themselves) follow a normal distribution. The most common tests are Kolmogorov-Smirnov and Shapiro-Wilk, and a Sig. value above 0.05 means that normality is not rejected. When the residuals are not normal, the first steps are to inspect a histogram and a Q-Q plot, check for data-entry errors and genuine outliers, and review the model specification. Remedies include transformation, robust or bootstrap methods, a larger sample, or a nonparametric test.
| Situation | Likely cause | Recommended action |
|---|---|---|
| Long right tail (skewed) | Income, yield, or price data | Log transformation of Y |
| A few extreme residuals | Entry errors or unusual units | Verify records; report results with and without them |
| Two peaks (bimodal) | Two subgroups mixed together | Add a dummy variable for the subgroup |
| Curved pattern in residual plot | Wrong functional form | Add a squared term or transform X |
| Large sample, mild deviation | Test too sensitive | Rely on the central limit theorem and plots |
What does normality mean in regression?
Normality is one of the classical assumptions of ordinary least squares (OLS) regression. The assumption concerns the error term: the residuals of the model should be approximately normally distributed. Normality is needed for the t-tests and F-tests to be exact in small samples. It is not needed for the coefficients to be unbiased, and it is not a requirement for each independent variable. A dummy variable, for instance, can never be normal, and that is not a violation.
The distinction between data and residuals is the most frequent source of confusion. In a t-test or ANOVA, the data within each group should be roughly normal, which is equivalent to normal residuals. In regression, Y itself may be skewed as long as the residuals, after accounting for the predictors, are approximately normal. Consequently, the normality test in regression should be applied to the saved residuals, not to Y or X.
How to test normality
Two families of tools exist: formal tests and visual checks. The Kolmogorov-Smirnov test (usually with the Lilliefors correction in SPSS) and the Shapiro-Wilk test compare the sample distribution with a normal distribution. Shapiro-Wilk has more power and is generally preferred for samples up to about 2,000. In both tests, the null hypothesis is that the data are normal, so Sig. > 0.05 means normality is not rejected.
Visual checks are equally important. A histogram with a normal curve shows the shape of the distribution, and a normal Q-Q plot shows how far each quantile departs from the normal line. Points that bend away at both ends indicate heavy tails, while points that curve upward indicate right skew. In SPSS, the histogram is available under Graphs, Legacy Dialogs, Histogram, with Display normal curve ticked; the Q-Q plot and both formal tests are available under Analyze, Descriptive Statistics, Explore, Plots, Normality plots with tests.
A good model with non-normal residuals
The following case shows a regression that performs well on every other criterion yet fails the normality test. The Kolmogorov-Smirnov test on the residuals is significant, indicating non-normality.

At the same time, the model has R-squared of about 0.70, a significant F-test, and significant t-tests for the predictors.

The histogram explains the contradiction. One range of values appears far more often than the normal curve would predict, forming a tall spike, while neighboring ranges are underrepresented.

Such a spike usually reflects how the data were collected rather than a statistical accident. In a farm income survey, for example, an enumerator may be guided by the first respondents toward their neighbors, who tend to be similar: successful farmers recommend other successful farmers, and large landholders recommend other large landholders. The sample then contains many similar households and few from the rest of the population. Thus, a lack of normality can be a symptom of a narrow sampling frame.
What should be done when residuals are not normal?
The appropriate response depends on the cause, and deleting observations until the histogram looks normal is not one of the legitimate options. Removing data to pass a test changes the population being described and undermines the credibility of the findings. The following steps, in order, address non-normality properly.
Firstly, the records are checked for errors. A yield of 60 tons per hectare where 6.0 was meant, or a missing-value code such as 999 entered as data, can create extreme residuals. Correcting such errors is legitimate, and the corrections should be documented. Secondly, genuine outliers are examined rather than removed. A very large farm or an unusually productive plot is part of reality; the analysis can be reported with and without these cases to show whether conclusions depend on them. Thirdly, the model specification is reviewed. Skewed residuals often disappear when Y is log-transformed, which is natural for income, yield, and price data. A bimodal distribution often signals a missing categorical variable, such as irrigated versus rainfed farms, and adding a dummy variable resolves it. A curved residual pattern signals a missing squared term.
Fourthly, when the problem persists, methods that do not rely on normality are used. Robust standard errors and bootstrap confidence intervals provide valid inference without the normality assumption. For comparisons of groups, nonparametric tests such as Mann-Whitney, Wilcoxon, and Kruskal-Wallis replace the t-test and ANOVA. Finally, for future data collection, the lesson is practical: a survey should deliberately cover the full range of the population, including small and large farms and profitable and unprofitable ones, rather than following convenient referrals.
Does normality matter in large samples?
With large samples, the central limit theorem ensures that the sampling distribution of the coefficients is approximately normal even when the residuals are not. With 200 or more observations, mild non-normality has little effect on the t-tests and F-tests. Paradoxically, formal normality tests become more sensitive as samples grow, so a large sample may fail the test because of a trivial deviation. A short scene from a thesis defense captures the point: a candidate with 400 respondents apologizes for a significant Shapiro-Wilk test, and the examiner asks to see the Q-Q plot instead. The points follow the line closely except at the far tails, and the examiner concludes that the inference is sound. Consequently, in large samples, the plots carry more weight than the p-value of the test.
Which normality check fits which analysis?
The object of the normality check depends on the analysis. For a one-sample or paired t-test, the differences or the single sample are checked. For an independent t-test or one-way ANOVA, the values within each group are checked, or equivalently the residuals of the ANOVA model. For linear regression, the residuals of the fitted model are checked after estimation. For correlation, bivariate normality matters mainly for small samples, and Spearman’s rank correlation offers an alternative. For logistic regression, Poisson regression, and other generalized linear models, normality of residuals is not an assumption at all, so a normality test is not required. Thus, a normality test applied mechanically to every variable in a dataset answers a question that the analysis does not ask.
Testing normality in Python
import statsmodels.formula.api as smf
from scipy import stats
import statsmodels.api as sm
model = smf.ols("income ~ land + labor + member", data=df).fit()
resid = model.resid
print(stats.shapiro(resid)) # Shapiro-Wilk
sm.qqplot(resid, line="45", fit=True) # Q-Q plot
Related guides on Catatan Budi: multiple linear regression, heteroscedasticity: detection and fixes, linearity test in regression, and one-way ANOVA in Python.
Frequently asked questions
What is a normality test?
A normality test checks whether data or residuals follow a normal distribution. In regression, it is applied to the residuals as one of the classical assumption tests.
Should normality be tested on the data or on the residuals?
In regression, on the residuals. In a t-test or ANOVA, on the data within each group, which is equivalent to testing the residuals of the model.
Which is better, Kolmogorov-Smirnov or Shapiro-Wilk?
Shapiro-Wilk generally has more power to detect non-normality and is preferred for small and moderate samples. Kolmogorov-Smirnov with the Lilliefors correction is an acceptable alternative.
Is it acceptable to delete data to achieve normality?
No. Data should be corrected only when they are verified errors. Genuine observations should be retained, and non-normality should be addressed through transformation, a better model, or methods that do not assume normality.
Does a log transformation always fix non-normality?
Not always. It works well for right-skewed positive data, such as income or yield, but it cannot be applied to zero or negative values and does not fix bimodal distributions caused by mixed subgroups.
Is a normality test needed for nonparametric tests?
No. Nonparametric tests such as Mann-Whitney, Wilcoxon, and Kruskal-Wallis do not assume normality, which is precisely why they are used when normality is doubtful.
References
- Shapiro, S. S., and Wilk, M. B. (1965). An analysis of variance test for normality (complete samples). Biometrika, 52(3–4), 591–611.
- Ghasemi, A., and Zahediasl, S. (2012). Normality tests for statistical analysis: A guide for non-statisticians. International Journal of Endocrinology and Metabolism, 10(2), 486–489.
- Wooldridge, J. M. (2020). Introductory Econometrics: A Modern Approach (7th ed.). Cengage.
Discussion
No comments yet. Have a question about this topic? Write it below and I will do my best to answer.