Skip to main content
Albero Academy

Choosing the Right Test

A practical map of the common statistical tests — t-tests, chi-squared, ANOVA and correlation — and how to pick the right one.

Chapter 13Statistics15 min readBeginner friendly
  • #Statistics
  • #Hypothesis Testing
  • #Tests

Chapter 3 covered hypothesis testing; the practical question is which test to run. The answer depends on your data types and what you're comparing. This chapter is a decision map for the everyday tests, so you can pick confidently rather than guessing.

The decision framework

Ask two questions: what type is your outcome, and what are you comparing?

QuestionTest
Is one numeric mean different from a value?One-sample t-test
Do two groups differ on a numeric 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

t-tests

The t-test family compares means. It returns a p-value; below 0.05 conventionally means "unlikely to be chance":

comparing means
from scipy import stats
stats.ttest_1samp(scores, 50) # vs a benchmark of 50
stats.ttest_ind(group_a, group_b) # two independent groups
stats.ttest_rel(before, after) # paired (same subjects)

ANOVA

For three or more groups, don't run many t-tests (it inflates false positives). ANOVA tests whether any group mean differs, in one test:

3+ groups
stats.f_oneway(group_a, group_b, group_c) # one-way ANOVA
# A significant result says "at least one differs" — follow up to find which.

Chi-squared

For relationships between categorical variables (is placement rate independent of programme?), use the chi-squared test:

categorical association
stats.chi2_contingency(contingency_table) # a table of counts

Practice

For each scenario, name the test: comparing average package across three programmes; before/after scores for the same students; whether placement (yes/no) depends on programme. Then run the appropriate scipy.stats test on sample data and interpret the p-value.

Key takeaways

  1. 01Pick a test by outcome type and what you're comparing.
  2. 02t-tests compare means: one-sample (vs a value), two-sample (two groups), paired (before/after).
  3. 03ANOVA compares 3+ group means in one test — don't run many t-tests instead.
  4. 04Chi-squared tests association between categorical variables.
  5. 05Match test to data and check assumptions (normality, independence, sample size).