Stats Test Flow Chart

Which statistical test should I use? Start with how many variables you have and what kind they are, follow the branches, and land on a test. Click any test to flip it over and see the formula the way it is written in a statistics class.

How to read it

Rounded cream boxes are questions about your data. Tan boxes are the answers that split the chart. The cards at the ends are the tests: click one to flip it and see its test statistic on the back, and the hypotheses, the full formula, what every symbol means and the decision rule appear in the Selected Test panel under the chart. The whole chart is one tree, about three screens wide at full size: use the + and − buttons to zoom, Fit to see all of it at once, and drag (or scroll) to move around. Looking for the R code instead? That is the Test Flow Chart under Data Science. The chart is adapted from statsandr.com.

Question Answer TestTest card
Parametric or nonparametric?
Independent or paired?

Parametric tests (z, t, F, Pearson) assume the quantitative variable is roughly normal in each group and work with means and standard deviations. Check with a histogram or a QQ plot. With samples of about 30 or more per group, mild skew is fine.

Nonparametric tests replace the values with their ranks, so they handle skew, outliers and ordinal data and ask about medians instead of means. The price is a little less power when the data really are normal.

Independent samples come from different subjects: a treatment group and a control group, men and women, three schools.

Paired samples measure the same subjects more than once, or matched pairs: before and after, left hand and right hand, twins. Pairing removes subject-to-subject noise, so the paired formulas work with the differences.

The chart

100%
  • How many variables?
    • 1 variable
      • Qualitative
        • 2 groups
        • > 2 groups
      • Quantitative
        • Parametric
        • Nonparametric
    • 2 variables
      • 2 qualitative
        • 2 groups for each variable
          • Paired samples
            • 2 paired samples
            • > 2 paired samples
          • Independent samples
            • Expected frequencies < 5
            • Expected frequencies ≥ 5
        • > 2 groups for at least one variable
      • 1 quantitative & 1 qualitative
        • Number of groups or samples to compare?
          • 2 groups
            • Independent samples
              • Parametric
                • Equal population variances
                • Unequal population variances
              • Nonparametric
            • Paired samples
              • Parametric
              • Nonparametric
          • > 2 groups
            • Independent samples
              • Parametric
                • Equal population variances
                • Unequal population variances
              • Nonparametric
            • Paired samples
              • Parametric
              • Nonparametric
      • 2 quantitative
        • Parametric
        • Nonparametric
    • > 2 variables
      • Quantitative dependent variable
      • Qualitative dependent variable
        • 2 groups
        • > 2 groups

Drag the chart to move around it, or scroll inside it. Zoom in until the cards are readable, then click a test to flip it.

Selected test

Click a test card anywhere in the chart and its hypotheses, formula, symbols and decision rule will appear here.

Every test on one page

The same 23 tests as a table with their test statistics, for a quick look before an exam.

TestUse whenTest statistic
One-proportion z testOne yes/no variable: is the proportion of successes equal to a claimed value?z = (p̂ − p0) / √( p0(1 − p0) / n )
Chi-square goodness of fit testOne categorical variable with 3 or more categories: do the counts match a claimed distribution?χ² = Σ (O − E)² / E,   df = k − 1
One-sample Student's t-testOne quantitative variable, roughly normal: is the mean equal to a claimed value?t = (x̄ − μ0) / (s / √n),   df = n − 1
One-sample Wilcoxon signed-rank testOne quantitative variable that is skewed or has outliers: is the center equal to a claimed value?W⁺ = Σ ranks of |xi − m0| with xi > m0
McNemar's testTwo paired yes/no measurements on the same subjects, such as before and after: did the proportion change?χ² = (b − c)² / (b + c),   df = 1
Cochran's Q testThree or more paired yes/no measurements on the same subjects: do the proportions differ across conditions?Q = (k − 1)[k Σ Cj² − (Σ Cj)²] / (k Σ Ri − Σ Ri²)
Fisher's exact testTwo categorical variables in a small table where some expected counts are below 5: are they related?p = (a+b)! (c+d)! (a+c)! (b+d)! / (a! b! c! d! n!)
Chi-square test of independenceTwo categorical variables: are they related (not independent)?χ² = Σ (O − E)² / E,   E = (row × col) / n
Student's t-test for 2 independent samplesTwo independent groups, quantitative outcome, roughly normal, similar spreads: do the means differ?t = (x̄1 − x̄2) / ( sp √(1/n1 + 1/n2) )
Welch's t-test for 2 independent samplesTwo independent groups, quantitative outcome, roughly normal, spreads that differ: do the means differ?t = (x̄1 − x̄2) / √( s12/n1 + s22/n2 )
Mann-Whitney U testTwo independent groups, quantitative or ordinal outcome, not normal: does one group tend to have larger values?U = n1n2 + n1(n1+1)/2 − R1
Student's t-test for paired samplesTwo measurements on the same subjects, quantitative, differences roughly normal: is the mean change zero?t = d̄ / (sd / √n),   df = n − 1
Wilcoxon signed-rank testTwo measurements on the same subjects, differences skewed or ordinal: is the typical change zero?W = min(W⁺, W⁻) over signed ranks of di
One-way ANOVAThree or more independent groups, quantitative outcome, roughly normal, similar spreads: do any means differ?F = MSbetween / MSwithin,   df = (k − 1, N − k)
Welch's ANOVAThree or more independent groups, quantitative, roughly normal, spreads that differ: do any means differ?F* = Σ wj(x̄j − x̄w)²/(k − 1) ÷ [1 + 2(k − 2)Λ/(k² − 1)]
Kruskal-Wallis testThree or more independent groups, outcome not normal or ordinal: do the groups differ?H = 12 / (N(N+1)) Σ Rj²/nj − 3(N+1)
Repeated measures ANOVAThree or more measurements on the same subjects, quantitative, roughly normal: do the means change across conditions?F = MSconditions / MSerror,   df = (k − 1, (k − 1)(n − 1))
Friedman testThree or more measurements on the same subjects, not normal or ordinal: do the conditions differ?χ²F = 12 / (nk(k+1)) Σ Rj² − 3n(k+1)
Pearson correlationTwo quantitative variables with a roughly linear, roughly normal relationship: are they correlated?r = Σ(x − x̄)(y − ȳ) / √( Σ(x − x̄)² Σ(y − ȳ)² )
Spearman's rank correlationTwo quantitative or ordinal variables with a monotonic but not necessarily linear relationship, or with outliers.rs = 1 − 6 Σ d² / ( n(n² − 1) )
Multiple linear regressionA quantitative outcome and two or more predictors: how does each predictor relate to the outcome, holding the others fixed?ŷ = b0 + b1x1 + b2x2 + … + bkxk
Binary logistic regressionA yes/no outcome and one or more predictors: what changes the odds of a yes?ln( p / (1 − p) ) = b0 + b1x1 + … + bkxk
Multinomial logistic regressionA categorical outcome with three or more unordered categories and one or more predictors.ln( P(Y=j) / P(Y=ref) ) = b0j + b1jx1 + …