Which Test?

How to

How to check if your data are normal

Many tests assume that the data are roughly normal. You do not need a test for that. A histogram and a Q-Q plot show it faster, and you decide with the sample size in mind.

What to look at

  • A histogram shows the shape of your data: symmetric like a bell, skewed, or with outliers.
  • A Q-Q plot compares your data with perfectly normal data. Points on the dashed line mean the data are roughly normal.
  • For paired data, check the differences within each pair, not the raw values.
  • Check each group separately when you compare groups.

How they look

Three made-up samples of 120 patients each. The same data in a histogram (left) and a Q-Q plot (right).

Roughly normal

Histogram: The bars form a symmetric bell around the middle.

Q-Q plot: The points follow the dashed line.

Right-skewed

Histogram: Most values are low, with a long tail to the right.

Q-Q plot: The points curve away from the line, and rise steeply at the top end.

With outliers

Histogram: A bell, plus a few bars far to the right.

Q-Q plot: Most points follow the line, but a few at the top end lie far above it.

How to make them in SPSS

  1. Choose Analyze > Descriptive Statistics > Explore.
  2. Put your outcome in "Dependent List". Put your group variable in "Factor List" (leave it empty for one group).
  3. Click Plots, tick "Histogram" and "Normality plots with tests", and continue.
  4. Click OK. The output has a histogram and a "Normal Q-Q Plot" per group, and a table "Tests of Normality".

Or paste this syntax in a syntax window (File > New > Syntax):

SPSS
* Histogram, normal Q-Q plot and Shapiro-Wilk test, per group.
EXAMINE VARIABLES=outcome BY group
  /PLOT=HISTOGRAM NPPLOT
  /STATISTICS=DESCRIPTIVES
  /CINTERVAL 95.

* For one group only (or the differences of paired data), leave out BY.
EXAMINE VARIABLES=outcome
  /PLOT=HISTOGRAM NPPLOT.

How to make them in R

R
# Histogram and Q-Q plot of one variable
hist(d$outcome)
qqnorm(d$outcome)
qqline(d$outcome)

# Per group (tidyverse)
library(tidyverse)
ggplot(d, aes(x = outcome)) + geom_histogram(bins = 15) + facet_wrap(~ group)
ggplot(d, aes(sample = outcome)) + stat_qq() + stat_qq_line() + facet_wrap(~ group)

# Shapiro-Wilk: look at W, not only at the p-value
shapiro.test(d$outcome)

How to decide

  • With about 25 or more observations per group, mild skew is fine for a t-test or ANOVA.
  • With fewer than about 25 and real doubt, use the non-parametric test.
  • Strong skew in a measurement that is always positive, such as lab values or length of stay: try a log transform and look at the plots again.
  • If you run Shapiro-Wilk, look at its W value (rule of thumb: W of 0.90 or higher is acceptable) rather than only at its p-value. In large samples a trivial deviation gives p below 0.05.
  • Do not use the plain Kolmogorov-Smirnov test; use Shapiro-Wilk or the Lilliefors-corrected version.

Based on the guidance in the decision tree, with sources: LECESSIE AMC ARM §11.9

Back to your choice

Now that you have looked at your data, go on with the test chooser, or read what the glossary says about normal distributions.