Two-sample t-test vs two-proportion z-test

By Jude Wallis · Published

Both tests compare two independent groups. The two-sample t-test compares means of a quantitative response, such as scores or hours. The two-proportion z-test compares proportions of a categorical response with two outcomes, such as pass or fail. The type of response variable decides.

This page spans two units of the Fall 2026 AP Statistics course. The two-proportion z-test is Unit 3 topics 3.12 and 3.13, and the two-sample t-test is Unit 4 topics 4.9 and 4.10. Choosing between them comes down to whether the response variable is categorical or quantitative.

Two-sample t-test vs two-proportion z-test: the short answer

The two tests answer the same kind of question, whether two groups differ, for two kinds of data.

When each individual contributes a number, such as a test score, a height, or a reaction time, the groups are summarized by means and you run a two-sample t-test on μ1−μ2\mu_1 - \mu_2.

When each individual contributes a category with two outcomes, such as passed or failed, the groups are summarized by proportions and you run a two-proportion z-test on p1−p2p_1 - p_2.

Look at what was recorded for one individual. A measurement points to the t-test. A yes or no points to the z-test. The words "average" and "mean" in a problem signal means, and "percent," "proportion," and "how many out of" signal proportions.

The two-sample t-test

The parameter is the difference between two population means, μ1−μ2\mu_1 - \mu_2, and the null hypothesis is H0:μ1−μ2=0H_0: \mu_1 - \mu_2 = 0. The test statistic is

t=xˉ1−xˉ2s12n1+s22n2t = \frac{\bar{x}_1 - \bar{x}_2}{\sqrt{\dfrac{s_1^2}{n_1} + \dfrac{s_2^2}{n_2}}}

Each group supplies three numbers: a sample size, a sample mean xˉ\bar{x} ("x-bar"), and a sample standard deviation ss. The p-value comes from a tt distribution with degrees of freedom supplied by technology.

Conditions: two independent random samples or a randomized experiment; each sample at most 10% of its population when sampling without replacement; and both sample sizes at least 30, or both populations stated to be approximately normal, or no strong skew or outliers in a smaller sample.

The reference curve is tt because the population standard deviations are unknown and each one is estimated by a sample standard deviation. That extra estimation adds uncertainty, and the heavier tails of the tt curve account for it.

The two-proportion z-test

The parameter is the difference between two population proportions, p1−p2p_1 - p_2, and the null hypothesis is H0:p1−p2=0H_0: p_1 - p_2 = 0. The test statistic is

z=p^1−p^2p^c(1−p^c)(1n1+1n2)z = \frac{\hat{p}_1 - \hat{p}_2}{\sqrt{\hat{p}_c(1-\hat{p}_c)\left(\dfrac{1}{n_1} + \dfrac{1}{n_2}\right)}}

where p^1\hat{p}_1 and p^2\hat{p}_2 ("p-hat") are the sample proportions and p^c=x1+x2n1+n2\hat{p}_c = \dfrac{x_1 + x_2}{n_1 + n_2} is the combined, or pooled, proportion of successes. Each group supplies two numbers: a count of successes and a sample size. The p-value comes from the standard normal distribution, which has no degrees of freedom.

Conditions: two independent random samples or a randomized experiment; the 10% condition when sampling without replacement; and large counts, meaning n1p^cn_1\hat{p}_c, n1(1−p^c)n_1(1-\hat{p}_c), n2p^cn_2\hat{p}_c, and n2(1−p^c)n_2(1-\hat{p}_c) are all at least 10.

The standard error is pooled because the null hypothesis says the two proportions are equal, so the best estimate of that shared value uses both samples together. A proportion also has no separate standard deviation to estimate: once a value of pp is assumed, the spread of p^\hat{p} follows from it. The setup is covered in one-proportion vs two-proportion z-test.

The differences side by side

FeatureTwo-sample t-testTwo-proportion z-test
Response variableQuantitativeCategorical with two outcomes
Parameterμ1−μ2\mu_1 - \mu_2p1−p2p_1 - p_2
Summary from each groupnn, xˉ\bar{x}, ssnn and a count of successes
Numeratorxˉ1−xˉ2\bar{x}_1 - \bar{x}_2p^1−p^2\hat{p}_1 - \hat{p}_2
Standard errors12n1+s22n2\sqrt{\dfrac{s_1^2}{n_1} + \dfrac{s_2^2}{n_2}}p^c(1−p^c)(1n1+1n2)\sqrt{\hat{p}_c(1-\hat{p}_c)\left(\dfrac{1}{n_1} + \dfrac{1}{n_2}\right)}
Pooled in the testNoYes
Reference distributiontt, with df from technologyStandard normal
Size conditionn≥30n \ge 30 in each group, or normal populations, or no strong skew or outliersAt least 10 expected successes and failures in each group

Both statistics are a difference divided by a standard error, and both null hypotheses set the difference to 0. Every row that differs traces back to the first one: the type of response variable.

When to use which

Start with the response variable for a single individual.

  • If it is a number you could average, and the question is about a typical value, use the two-sample t-test.
  • If it is one of two categories, and the question is about how common one category is, use the two-proportion z-test.

Then confirm that the two groups are independent. Both tests need two separate groups of individuals. Paired quantitative data go to a one-sample t-test on the differences.

A quantitative variable can be turned into a categorical one, and the test changes with it. Exam scores are quantitative, so comparing mean scores is a t-test. "Scored 70 or above" is a yes or no for each student, so comparing pass rates from the same exam is a z-test. The two analyses answer different questions and can reach different conclusions.

If the categorical response has three or more outcomes, neither test fits and a chi-square test for homogeneity is the tool, as chi-square tests explained covers. The wider decision is laid out in which statistical test to use.

The classic mix-up and how to avoid it

The usual error is choosing the test from the word "two" or from the sample sizes and skipping the data type. Averages, standard deviations, and units such as points, minutes, or grams signal a t-test. Counts out of a total and percentages signal a z-test. A problem that gives xˉ\bar{x} and ss cannot be a proportion test, and a problem that gives "63 of 120" has no ss to put into a t statistic.

Three related slips follow from blurring the two:

  • Using a tt critical value or degrees of freedom for proportions. Proportion tests use the standard normal curve.
  • Checking the wrong condition. Large counts belongs to proportions. Sample size 30, or a normal population, belongs to means.
  • Pooling the wrong test. The two-proportion test pools p^c\hat{p}_c. The two-sample t-test in this course does not pool the standard deviations, as pooled or not on a two-sample t-test explains.

To avoid all of them, write the parameter in symbols before anything else. Writing μ1−μ2\mu_1 - \mu_2 or p1−p2p_1 - p_2 forces the choice, and the correct formula, curve, and conditions follow from it.

One experiment, pass rates: a two-proportion z-test

In an experiment, 300 students are randomly assigned, 150 to a new study app and 150 to the standard review packet. On the unit exam, 90 app students and 72 packet students pass. Test at α=0.05\alpha = 0.05 whether the pass rates differ.

  1. Identify the response. Each student either passed or did not, a categorical variable with two outcomes, so compare proportions with a two-proportion z-test.

  2. State the hypotheses: H0:p1−p2=0H_0: p_1 - p_2 = 0 and Ha:p1−p2≠0H_a: p_1 - p_2 \neq 0, where p1p_1 and p2p_2 are the true pass rates for students like these using the app and using the packet.

  3. Sample proportions: p^1=90150=0.60\hat{p}_1 = \frac{90}{150} = 0.60 and p^2=72150=0.48\hat{p}_2 = \frac{72}{150} = 0.48.

  4. Pooled proportion: p^c=90+72150+150=162300=0.54\hat{p}_c = \frac{90 + 72}{150 + 150} = \frac{162}{300} = 0.54.

  5. Check conditions: treatments were randomly assigned; the expected counts are 150(0.54)=81150(0.54) = 81 and 150(0.46)=69150(0.46) = 69 in each group, all at least 10.

  6. Standard error: 0.54×0.46×(1150+1150)=0.2484×0.013333=0.003312=0.05755\sqrt{0.54 \times 0.46 \times \left(\frac{1}{150} + \frac{1}{150}\right)} = \sqrt{0.2484 \times 0.013333} = \sqrt{0.003312} = 0.05755.

  7. Test statistic: z=0.60−0.480.05755=2.085z = \frac{0.60 - 0.48}{0.05755} = 2.085.

  8. Two-sided p-value from the standard normal curve: 0.0371. Since 0.0371≤0.050.0371 \le 0.05, reject H0H_0.

z=2.085z = 2.085 and the p-value is 0.0371. Reject H0H_0: there is convincing evidence that the pass rate differs between the app and the packet for students like these. The data were counts of a yes or no outcome, so the test used proportions, a pooled standard error, and the normal curve.

The same experiment, exam scores: a two-sample t-test

In the same experiment, the exam scores themselves are recorded. App group: n1=150n_1 = 150, xˉ1=78.2\bar{x}_1 = 78.2, s1=10.5s_1 = 10.5. Packet group: n2=150n_2 = 150, xˉ2=75.1\bar{x}_2 = 75.1, s2=11.2s_2 = 11.2. Test at α=0.05\alpha = 0.05 whether the mean scores differ.

  1. Identify the response. Each student contributes a score, a quantitative variable, so compare means with a two-sample t-test.

  2. State the hypotheses: H0:μ1−μ2=0H_0: \mu_1 - \mu_2 = 0 and Ha:μ1−μ2≠0H_a: \mu_1 - \mu_2 \neq 0, where μ1\mu_1 and μ2\mu_2 are the true mean exam scores for students like these using the app and using the packet.

  3. Check conditions: treatments were randomly assigned, and both group sizes are 150, which is at least 30.

  4. Variance terms: 10.52150=110.25150=0.7350\frac{10.5^2}{150} = \frac{110.25}{150} = 0.7350 and 11.22150=125.44150=0.8363\frac{11.2^2}{150} = \frac{125.44}{150} = 0.8363.

  5. Standard error: 0.7350+0.8363=1.5713=1.2535\sqrt{0.7350 + 0.8363} = \sqrt{1.5713} = 1.2535.

  6. Test statistic: t=78.2−75.11.2535=2.473t = \frac{78.2 - 75.1}{1.2535} = 2.473.

  7. Degrees of freedom from technology: 296.77. The two-sided p-value is 0.0140. Since 0.0140≤0.050.0140 \le 0.05, reject H0H_0.

t=2.473t = 2.473 with 296.77 degrees of freedom and a p-value of 0.0140. Reject H0H_0: there is convincing evidence that the mean exam score differs between the app and the packet for students like these. The same students produced a z-test when the response was pass or fail and a t-test when it was the score.

Frequently asked questions

How do I tell means from proportions in a word problem?

Ask what was recorded for one individual. A number with units, summarized by an average and a standard deviation, means a t-test for means. A category with two outcomes, summarized by a count or percent, means a z-test for proportions.

Why does one test use z and the other use t?

A test for means has to estimate each population standard deviation with a sample standard deviation, and the tt distribution accounts for that extra uncertainty. A test for proportions has no separate standard deviation to estimate, because the spread of a sample proportion is determined by the proportion itself, so the standard normal curve is used.

Can I use a two-proportion z-test when there are three categories?

No. A two-proportion z-test needs a response with two outcomes, success or failure. With three or more categories, compare the groups with a chi-square test for homogeneity, which handles the whole distribution of a categorical variable at once.