Skip to main content
Albero Academy

Choosing a Test

A map of the common tests and how to pick one.

Inference9 min

Once you understand testing, the practical question is which test to run. The answer depends on your data types and what you're comparing — here's a decision map for the everyday tests.

The decision map

QuestionTest
Is one mean different from a value?One-sample t-test
Do two groups differ on a mean?Two-sample t-test
Before vs after on the same subjects?Paired t-test
Do 3+ groups differ on a mean?ANOVA
Are two categorical variables related?Chi-squared
Do two numeric variables move together?Correlation test
with scipy
from scipy import stats
stats.ttest_ind(group_a, group_b) # two independent groups
stats.f_oneway(g1, g2, g3) # ANOVA — 3+ groups
stats.chi2_contingency(table) # categorical association

Key takeaways

  1. 01Choose a test by data types and what you're comparing.
  2. 02t-tests compare means (one-sample, two-sample, paired); ANOVA compares 3+ group means.
  3. 03Chi-squared tests association between categorical variables.
  4. 04Don't run many t-tests for 3+ groups; check each test's assumptions.

Finished this chapter?

Mark it complete to track your progress through Statistics.