Which statistical test should I use? A decision guide

By Jude Wallis · Published

Pick a test from two things: your data type and your design. Categorical data (proportions or counts) points to a one-proportion z, two-proportion z, or chi-square test. Quantitative data (means) points to a one-sample, two-sample, or paired t test, or to regression for two variables.

This guide spans the AP inference units (Units 3 to 5); note that the Fall 2026 redesign removed the chi-square goodness-of-fit test and inference for a regression slope, so regression appears here as description only.

Start with the type of your data

Choosing a statistical test comes down to two questions: what kind of data you have, and how it was collected. Answer those and the right test almost always falls out.

Your first split is the type of the response variable.

  • Categorical data sorts each subject into a group, like yes/no, pass/fail, or brand A versus brand B. You summarize it with a proportion. The AP name for the sample proportion is p^\hat{p} (read "p-hat").
  • Quantitative data is a number you measure, like height, time, or a score. You summarize it with a mean. The sample mean is xˉ\bar{x} (read "x-bar") and the population mean is μ\mu (the Greek letter mu).

Categorical data leads to z tests for proportions or a chi-square test. Quantitative data leads to t tests for means or to regression.

The decision walkthrough

Work through these questions in order.

  1. Is the response variable categorical or quantitative? Counts and proportions are categorical. Measured numbers are quantitative.
  2. How many samples or groups do you have? One, two, or more than two.
  3. If two samples, are they paired or independent? Paired means each value in one group is matched to a specific value in the other, such as the same subject measured twice. Independent means the two groups have no such link.
  4. Match your answers to a test using the sections and the table below.

That is the whole method for choosing a statistical test. The rest of this guide spells out what each branch lands on.

Tests for categorical data

These tests handle proportions and counts, which is Unit 3 of the AP course.

One sample, one proportion. You have one group and want to compare its proportion to a claimed value, such as testing whether the share of defective parts is 5 percent. Use the one-proportion z test. See the proportion z-test calculator.

Two independent samples. You compare a proportion in one group to a proportion in another, such as the recovery rate for a treatment versus a placebo. Use the two-proportion z test, also in the proportion z-test calculator. For the contrast between these two, see one-proportion vs two-proportion z test.

Two categorical variables, or several groups. When your data is a two-way table of counts, use a chi-square test (its test statistic is written χ2\chi^2, read "chi-square"). A test of independence checks whether two categorical variables are associated within one sample. A test of homogeneity compares the distribution of one categorical variable across several groups. Both use the chi-square calculator, and both are covered in chi-square tests explained.

The goodness-of-fit test for a single categorical variable was removed from the AP exam effective Fall 2026.

Tests for quantitative data

These tests handle means, which is Unit 4 of the AP course. Each one uses a t statistic because you estimate the population standard deviation from your sample.

One sample, one mean. You compare one group's mean to a claimed value, such as testing whether a machine fills bottles to 500 ml on average. Use the one-sample t test. See the one-sample t-test calculator. The standard error is s/ns/\sqrt{n}, where ss is the sample standard deviation and nn is the sample size.

Two independent samples. You compare the mean of one group to the mean of a separate, unlinked group, such as scores from two different classes. Use the two-sample t test. See the two-sample t-test calculator. The standard error is s12n1+s22n2\sqrt{\frac{s_1^2}{n_1} + \frac{s_2^2}{n_2}}.

Paired data. When every value in one column is tied to a specific value in the other, such as before and after on the same person, compute each difference first, then run a one-sample t test on those differences. The AP course calls this inference for a mean difference. Feed the differences into the one-sample t-test calculator.

Two quantitative variables: regression

When you measure two quantitative variables on each subject and want to describe how they move together, fit a least-squares regression line, which is Unit 5 of the AP course. The predicted value is written y^=a+bx\hat{y} = a + bx, where aa is the y-intercept and bb is the slope. See the regression calculator and least-squares regression line.

On the Fall 2026 AP exam, regression is descriptive. You fit the line and interpret the slope, the correlation rr, and the residuals, but you do not run a significance test for the slope. Inference for a regression slope was removed from the AP course effective Fall 2026, though it stays standard in college statistics.

Paired or independent, the distinction that trips people up

The most common wrong turn is treating paired data as two independent samples. Ask whether each observation in one group has a natural partner in the other.

  • Same subjects measured twice, such as before and after: paired.
  • Subjects deliberately matched by a trait like age or weight, one assigned to each treatment: paired.
  • Two separate groups with no matching, even when they are the same size: independent.

Pairing changes the test. Independent quantitative groups use the two-sample t test, while paired data collapses to one column of differences and uses a one-sample t test. Getting this wrong changes both your standard error and your degrees of freedom.

z or t, and the quick-reference table

Proportions use z and means use t. The short reason is that a proportion has no separately estimated standard deviation, since its spread is a fixed function of the proportion itself, while a mean's standard error uses the sample standard deviation ss as an estimate, which adds the uncertainty that the t distribution accounts for. For the full comparison, see t-test vs z-test.

Your situationTest to useCalculator
One sample, a proportion vs a claimed valueOne-proportion z testopen
Two independent samples, proportionsTwo-proportion z testopen
Two-way table or several groups, countsChi-square testopen
One sample, a mean vs a claimed valueOne-sample t testopen
Two independent samples, meansTwo-sample t testopen
Paired or matched data, meansPaired t (one-sample t on differences)open
Relationship between two quantitative variablesLeast-squares regressionopen

Two classes, two means: a two-sample t test

A teacher compares quiz scores from two independent classes. Class A scored 4, 6, 8. Class B scored 1, 3, 5. Which test applies, and what is the test statistic?

  1. The response is a quiz score, which is quantitative, and the two classes are separate groups with no matching, so this is a two-sample t test.

  2. Class A mean: xˉ1=(4+6+8)/3=18/3=6\bar{x}_1 = (4 + 6 + 8)/3 = 18/3 = 6, where xˉ1\bar{x}_1 is the sample mean of Class A.

  3. Class A sample variance: the deviations from 6 are -2, 0, 2, so s12=(2)2+02+2231=4+0+42=82=4s_1^2 = \frac{(-2)^2 + 0^2 + 2^2}{3 - 1} = \frac{4 + 0 + 4}{2} = \frac{8}{2} = 4.

  4. Class B mean: xˉ2=(1+3+5)/3=9/3=3\bar{x}_2 = (1 + 3 + 5)/3 = 9/3 = 3.

  5. Class B sample variance: the deviations from 3 are -2, 0, 2, so s22=4+0+42=4s_2^2 = \frac{4 + 0 + 4}{2} = 4.

  6. Standard error of the difference: s12n1+s22n2=43+43=83=2.66667=1.63299\sqrt{\frac{s_1^2}{n_1} + \frac{s_2^2}{n_2}} = \sqrt{\frac{4}{3} + \frac{4}{3}} = \sqrt{\frac{8}{3}} = \sqrt{2.66667} = 1.63299.

  7. Test statistic: t=xˉ1xˉ20SE=631.63299=31.63299=1.8371t = \frac{\bar{x}_1 - \bar{x}_2 - 0}{SE} = \frac{6 - 3}{1.63299} = \frac{3}{1.63299} = 1.8371.

  8. Conservative degrees of freedom: the smaller of n11n_1 - 1 and n21n_2 - 1, which is 31=23 - 1 = 2. The two-sample t-test calculator uses the technology (Welch-Satterthwaite) formula instead, which for this data works out to 4, so expect 4 degrees of freedom on screen rather than 2.

A two-sample t test, with t1.837t \approx 1.837. The conservative rule gives 2 degrees of freedom; the calculator's technology formula reports 4.

Before and after on the same students: a paired t test

Five students take a test before and after a study session. Before: 70, 62, 80, 55, 68. After: 75, 66, 79, 62, 73. Which test applies, and what is the test statistic?

  1. Each student is measured twice, so the two columns are paired. Compute each difference (after minus before) and run a one-sample t test on those differences.

  2. Differences: 75 - 70 = 5, 66 - 62 = 4, 79 - 80 = -1, 62 - 55 = 7, 73 - 68 = 5. The differences are 5, 4, -1, 7, 5.

  3. Mean difference: xˉd=(5+41+7+5)/5=20/5=4\bar{x}_d = (5 + 4 - 1 + 7 + 5)/5 = 20/5 = 4, where xˉd\bar{x}_d is the sample mean of the differences.

  4. Deviations from 4 are 1, 0, -5, 3, 1. Their squares are 1, 0, 25, 9, 1, which sum to 36.

  5. Sample standard deviation of the differences: sd=3651=364=9=3s_d = \sqrt{\frac{36}{5 - 1}} = \sqrt{\frac{36}{4}} = \sqrt{9} = 3.

  6. Standard error: sd/n=3/5=3/2.23607=1.34164s_d/\sqrt{n} = 3/\sqrt{5} = 3/2.23607 = 1.34164.

  7. Test statistic: t=xˉd0SE=41.34164=2.9814t = \frac{\bar{x}_d - 0}{SE} = \frac{4}{1.34164} = 2.9814.

  8. Degrees of freedom: n1=51=4n - 1 = 5 - 1 = 4.

A paired t test, run as a one-sample t test on the differences, with t2.981t \approx 2.981 and 4 degrees of freedom.

Two treatment groups, one success rate: a two-proportion z test

In a trial, 40 of 50 patients recover on treatment A and 30 of 50 recover on treatment B. Which test applies, and what is the test statistic?

  1. Recovery is categorical (a patient recovers or does not) and the two treatment groups are independent, so this is a two-proportion z test.

  2. Sample proportions: p^1=40/50=0.80\hat{p}_1 = 40/50 = 0.80 and p^2=30/50=0.60\hat{p}_2 = 30/50 = 0.60, where each p^\hat{p} is a sample proportion.

  3. The null hypothesis assumes the two proportions are equal, so pool them: p^c=n1p^1+n2p^2n1+n2=40+3050+50=70100=0.70\hat{p}_c = \frac{n_1\hat{p}_1 + n_2\hat{p}_2}{n_1 + n_2} = \frac{40 + 30}{50 + 50} = \frac{70}{100} = 0.70.

  4. Pooled standard error: p^c(1p^c)n1+p^c(1p^c)n2=0.70(0.30)50+0.70(0.30)50=0.2150+0.2150\sqrt{\frac{\hat{p}_c(1 - \hat{p}_c)}{n_1} + \frac{\hat{p}_c(1 - \hat{p}_c)}{n_2}} = \sqrt{\frac{0.70(0.30)}{50} + \frac{0.70(0.30)}{50}} = \sqrt{\frac{0.21}{50} + \frac{0.21}{50}}.

  5. Continue: 0.0042+0.0042=0.0084=0.09165\sqrt{0.0042 + 0.0042} = \sqrt{0.0084} = 0.09165.

  6. Test statistic: z=p^1p^20SE=0.800.600.09165=0.200.09165=2.1822z = \frac{\hat{p}_1 - \hat{p}_2 - 0}{SE} = \frac{0.80 - 0.60}{0.09165} = \frac{0.20}{0.09165} = 2.1822.

A two-proportion z test, with z2.182z \approx 2.182.

Frequently asked questions

How do I know if my data is categorical or quantitative?

Ask what a single data value looks like. If it is a label or category, such as yes, red, or brand B, it is categorical and you summarize it with a proportion. If it is a measured number you could average, such as height, seconds, or dollars, it is quantitative and you summarize it with a mean.

When do I use a z test instead of a t test?

Use z for proportions and t for means. A proportion has no separately estimated standard deviation, since its spread is fixed by the proportion itself, so it uses z. A mean's standard error estimates the population standard deviation from the sample, which adds uncertainty, so it uses t. See t-test vs z-test.

Is a paired t test a different test from a one-sample t test?

No. A paired t test is a one-sample t test run on the column of differences. You compute each pair's difference first, then test whether the mean difference is zero. That is why the AP course lists it under inference for a mean difference.

Which test do I use for a two-way table?

A chi-square test. Use a test of independence when the counts come from one sample classified by two categorical variables, and a test of homogeneity when you compare one categorical variable across several groups. Both use the same χ2\chi^2 statistic.