Study and Productivity

How to Choose the Right Statistical Test and Check Its Assumptions

Pick a t-test, ANOVA, chi-square or a non-parametric test from your design, then check normality with Shapiro-Wilk and equal spread with Levene's test.

Saizul Amin
Saizul Amin3 Nov 2026 · 4 min read
How to Choose the Right Statistical Test and Check Its Assumptions

How to Choose the Right Statistical Test and Check Its Assumptions

"Which test should I use?" is the question students ask most often in a research methods course, and it usually arrives a week before the deadline. The good news is that the choice follows from a handful of facts about your study design. The bad news is that each test comes with assumptions, and a test run on data that break them can give a confident but wrong answer. This guide shows the decision path and the two assumption checks you will meet most often. The statistical test chooser and assumption checker follows the same path and runs the checks on your own data.

Five questions decide the test

  1. What is your goal? Compare groups, relate two variables, test association between categories, compare one sample with a fixed value, or predict an outcome.
  2. What type is the outcome? Continuous (height, score), ordinal (a 1 to 5 rating), binary (pass or fail) or categorical with several levels.
  3. How many groups? One, two, or three and more.
  4. Are the measurements paired? The same people measured twice, or matched pairs, are paired; different people in each group are independent.
  5. Do the data look normal, and are the group variances similar?

From these answers the path is short. Two independent groups with a continuous, roughly normal outcome lead to a t-test: Student's version if the variances are similar, Welch's if they are not (Welch is a safe default). The same groups with skewed or ordinal data lead to the Mann-Whitney U test. Two paired measurements give the paired t-test or the Wilcoxon signed-rank test. Three or more independent groups give one-way ANOVA, Welch's ANOVA or the Kruskal-Wallis test; with repeated measurements, repeated-measures ANOVA or the Friedman test. Two categorical variables give the chi-square test of independence, or Fisher's exact test when expected counts are small. Two continuous variables give Pearson correlation, or Spearman's rank correlation for curved or ordinal relationships.

Checking normality with Shapiro-Wilk

The Shapiro-Wilk test asks whether a sample could plausibly come from a normal distribution. Its statistic W is close to 1 for normal-looking data and smaller for skewed or heavy-tailed data. The p-value comes from Royston's 1995 approximation (algorithm AS R94), which works from 3 to 5000 values.

Take eleven blood pressure readings: 148, 154, 158, 160, 161, 162, 166, 170, 182, 195 and 236. One reading is far above the rest. Shapiro-Wilk gives W ≈ 0.789 and p ≈ 0.0067, well below 0.05, so normality is doubtful. A Q-Q plot tells the same story: the points follow a line until the last two, which bend sharply upward.

Two cautions. With small samples the test has little power, so a large p-value does not prove normality. With large samples it flags trivial departures that do not matter for a t-test, because the central limit theorem makes the mean close to normal once each group has about 30 values. Read the test together with the Q-Q plot, the skewness and the sample size.

Checking equal variances with Levene's test

Student's t-test and classic ANOVA assume the groups have similar spread. Levene's test checks this by comparing the absolute deviations of each value from its group centre. The Brown-Forsythe variant uses the group median instead of the mean, which makes it robust to skewed data, and the NIST/SEMATECH e-Handbook recommends it for that reason. A p-value below 0.05 suggests the variances differ; then use Welch's t-test or Welch's ANOVA.

A quick rule of thumb also helps: if the largest group standard deviation is more than about twice the smallest, treat the variances as unequal.

Outliers

Values beyond the Tukey fences, Q1 − 1.5 × IQR and Q3 + 1.5 × IQR, deserve a look. Do not delete them automatically. Check whether they are typing errors, real but unusual cases, or a sign that a rank-based test is the better choice.

Report the effect size

A p-value says whether an effect is detectable, not how large it is. Pair each test with an effect size: Cohen's d for t-tests, eta squared for ANOVA, r for rank tests, Cramér's V for chi-square. The chooser lists the matching effect size with every recommendation.

Practising

The quiz tab gives short study descriptions and asks you to name the test, then explains the answer. A few rounds before an exam make the decision path automatic.

Limits

The chooser covers the common tests taught in introductory and intermediate courses. It does not cover multilevel models, survival analysis, Bayesian methods or power analysis, and it cannot judge whether your sampling or measurement was sound. Assumption tests are guides, not verdicts. When the stakes are high, such as a thesis or a clinical study, confirm the plan with your supervisor or a statistician.

Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages