Medical AtlasPROJECT IMG
✎ Sketch Notes🏛️ 3D LibraryMy Desk

Choosing a statistical test (t-test, ANOVA, chi-square)

The right statistical test depends on the type of outcome variable and the number of groups. Compare means of two groups with a t-test, three or more groups with ANOVA, proportions with chi-square (or Fisher exact for small samples), and two continuous variables with correlation.

Overview

To pick a test, ask two questions: (1) What type of data is the outcome? (continuous vs categorical) and (2) How many groups are compared, and are they independent or paired?

Test selection table

Outcome / comparisonTestExample
Means of 2 independent groupsTwo-sample (unpaired) t-testMean HbA1c in drug vs placebo group
Means in the same people before and after (or matched pairs)Paired t-testBlood pressure before and after a drug in one group
Sample mean vs a known population meanOne-sample t-testMean height in a clinic vs national mean
Means of 3 or more groupsANOVA (analysis of variance)Mean LDL in vegans, vegetarians and omnivores
Proportions / categorical outcomes in 2 or more groupsChi-square testPercentage with MI in smokers vs nonsmokers
Categorical, small expected counts (under 5 in a cell)Fisher exact testRare complication in a small trial
Paired categorical dataMcNemar testSame patients' symptom yes/no before and after
Two continuous variablesPearson correlation; linear regressionAge and systolic blood pressure
Ordinal or skewed dataNonparametric: Mann-Whitney U, Wilcoxon signed-rank, Kruskal-Wallis, SpearmanPain scores
Time to eventKaplan-Meier with log-rank; Cox regressionSurvival after cancer surgery
Binary outcome with multiple predictorsLogistic regression (gives adjusted OR)Predictors of readmission

Memory aids

  • T-test: two means.
  • ANOVA: three or more means ("Analysis Of VAriance").
  • Chi-square: categories ("chi-tegorical"), percentages and proportions.
  • Paired = same people measured twice.

Why not multiple t-tests?

Comparing three groups with three separate t-tests inflates the type I error rate. ANOVA tests all groups at once; if significant, post hoc tests (for example Tukey) identify which pairs differ. A significant ANOVA only says at least one mean differs.

Parametric vs nonparametric

Parametric tests (t-test, ANOVA, Pearson) assume roughly normal distributions and continuous data. When data are skewed, ordinal, or samples are small, nonparametric tests based on ranks are used. They are less powerful when data really are normal.

Worked examples

  • Compare mean birth weight in babies of smoking vs nonsmoking mothers: unpaired t-test.
  • Compare mean birth weight among mothers who smoke none, 1-10, or more than 10 cigarettes daily: ANOVA.
  • Compare the percentage of low-birth-weight babies between smokers and nonsmokers: chi-square.
  • Compare a patient group's cholesterol before and after a diet: paired t-test.
  • Relationship between number of cigarettes per day and birth weight: correlation/linear regression.

Exam approach in three steps

  1. Find the outcome variable in the question stem and decide whether it is a number (mean blood pressure, weight, score) or a category (yes/no, percentage with disease, stage).
  2. Count the groups being compared and check whether the same people are measured twice (paired) or different people are compared (independent).
  3. Check for special features: time-to-event data, very small counts, skewed data, or the need to adjust for several confounders at once (regression).

Most exam questions resolve after step 2: numbers in two groups means t-test, numbers in three or more groups means ANOVA, and categories means chi-square. Watch for distractors that describe the predictor rather than the outcome; the test is chosen by the type of outcome data being compared.

🧭 Algorithm: Choosing a statistical test

1. What kind of outcome?
A number (mean BP, weight) → continuous. A category (yes/no, % with disease) → categorical. Time until an event → survival. Two continuous variables together → correlation/regression.
Continuous outcome
2 independent groups → unpaired t-test · same people twice → paired t-test · vs a known mean → one-sample t-test · ≥3 groups → ANOVA (+ post hoc, e.g., Tukey).
Skewed, ordinal or tiny samples
Nonparametric: Mann–Whitney U · Wilcoxon signed-rank (paired) · Kruskal–Wallis (≥3 groups).
Categorical outcome
Chi-square; Fisher exact if any expected cell <5; McNemar for paired proportions.
Relationship / adjustment
Pearson r (Spearman for ranks); linear regression for a continuous outcome; logistic regression → adjusted OR for a binary outcome.
Time-to-event
Kaplan–Meier + log-rank test; Cox proportional hazards → hazard ratio.
2. Check for traps
Same subjects measured twice? Several groups (don't run multiple t-tests)? Need to adjust for confounders?

Key thresholds

  • Two means → t-test; ≥3 means → ANOVA
  • Proportions → chi-square; expected count <5 → Fisher exact
  • Multiple t-tests inflate the type I error
  • r² = proportion of variance explained

📚 Source: USMLE epidemiology/biostatistics content outline; standard biostatistics references — reviewed 2026-11

🔥 Exam pearls

  • Two group means = t-test (paired if same subjects).
  • Three or more group means = ANOVA.
  • Proportions or categorical outcomes = chi-square; small counts = Fisher exact.
  • Two continuous variables = correlation or regression.
  • Time-to-event = Kaplan-Meier, log-rank, Cox (hazard ratio).
  • Skewed or ordinal data = nonparametric tests.
© 2026 Project IMG · Content from Project IMG labs and atlases · For education only, not medical advice.