Sign in to save

Bookmark this page so you can find it later.

Sign in to save

Bookmark this page so you can find it later.

Two-sample tests compare the means or proportions of two independent groups to decide whether an observed difference is statistically meaningful. This cheat sheet helps students choose between a two-sample t-test and a two-sample z-test, set up hypotheses, and interpret results. It is useful for classwork, exams, and data investigations where two groups are being compared.

Key Facts

  • Use a two-sample t-test for independent means when population standard deviations are unknown, with test statistic t=xˉ1xˉ2Δ0s12n1+s22n2t = \frac{\bar{x}_1 - \bar{x}_2 - \Delta_0}{\sqrt{\frac{s_1^2}{n_1} + \frac{s_2^2}{n_2}}}.
  • Use a two-sample z-test for independent means when population standard deviations are known, with test statistic z=xˉ1xˉ2Δ0σ12n1+σ22n2z = \frac{\bar{x}_1 - \bar{x}_2 - \Delta_0}{\sqrt{\frac{\sigma_1^2}{n_1} + \frac{\sigma_2^2}{n_2}}}.
  • For two proportions, use z=p^1p^20p^(1p^)(1n1+1n2)z = \frac{\hat{p}_1 - \hat{p}_2 - 0}{\sqrt{\hat{p}(1 - \hat{p})\left(\frac{1}{n_1} + \frac{1}{n_2}\right)}}, where p^=x1+x2n1+n2\hat{p} = \frac{x_1 + x_2}{n_1 + n_2} for a hypothesis test with H0:p1=p2H_0: p_1 = p_2.
  • A confidence interval for the difference of two means is (xˉ1xˉ2)±ts12n1+s22n2(\bar{x}_1 - \bar{x}_2) \pm t^*\sqrt{\frac{s_1^2}{n_1} + \frac{s_2^2}{n_2}} when using sample standard deviations.
  • A confidence interval for the difference of two proportions is (p^1p^2)±zp^1(1p^1)n1+p^2(1p^2)n2(\hat{p}_1 - \hat{p}_2) \pm z^*\sqrt{\frac{\hat{p}_1(1 - \hat{p}_1)}{n_1} + \frac{\hat{p}_2(1 - \hat{p}_2)}{n_2}}.
  • The null hypothesis usually states no difference, such as H0:μ1μ2=0H_0: \mu_1 - \mu_2 = 0 or H0:p1p2=0H_0: p_1 - p_2 = 0.
  • Reject H0H_0 when the p-value is less than the significance level α\alpha, such as p<0.05p < 0.05.
  • Two-sample tests require independent samples, random sampling or random assignment, and approximately normal sampling distributions.

Vocabulary

Two-sample test
A statistical test used to compare a parameter, such as a mean or proportion, between two independent groups.
Null hypothesis
The claim being tested that usually says there is no difference, such as H0:μ1μ2=0H_0: \mu_1 - \mu_2 = 0.
Alternative hypothesis
The claim that represents a difference or direction of change, such as Ha:μ1μ20H_a: \mu_1 - \mu_2 \ne 0.
Standard error
The estimated standard deviation of a sampling distribution, such as SE=s12n1+s22n2SE = \sqrt{\frac{s_1^2}{n_1} + \frac{s_2^2}{n_2}} for two sample means.
P-value
The probability of getting a test statistic at least as extreme as the observed one, assuming the null hypothesis is true.
Significance level
The cutoff probability α\alpha used to decide whether evidence is strong enough to reject the null hypothesis.

Common Mistakes to Avoid

  • Using a z-test when population standard deviations are unknown is wrong because sample standard deviations require the t-distribution for means.
  • Pooling proportions in a confidence interval is wrong because p^=x1+x2n1+n2\hat{p} = \frac{x_1 + x_2}{n_1 + n_2} is used for the hypothesis test under H0:p1=p2H_0: p_1 = p_2, not for estimating the interval.
  • Forgetting to check independence is wrong because two-sample formulas assume the groups do not influence each other.
  • Interpreting a large p-value as proof that H0H_0 is true is wrong because it only means the sample did not provide strong enough evidence against H0H_0.
  • Reversing the order of subtraction is wrong when the conclusion depends on direction, since xˉ1xˉ2\bar{x}_1 - \bar{x}_2 and xˉ2xˉ1\bar{x}_2 - \bar{x}_1 have opposite signs.

Practice Questions

  1. 1 Two independent samples have xˉ1=84\bar{x}_1 = 84, s1=10s_1 = 10, n1=25n_1 = 25, xˉ2=78\bar{x}_2 = 78, s2=12s_2 = 12, and n2=30n_2 = 30. Compute the two-sample t statistic for testing H0:μ1μ2=0H_0: \mu_1 - \mu_2 = 0.
  2. 2 A survey finds x1=64x_1 = 64 successes out of n1=100n_1 = 100 and x2=45x_2 = 45 successes out of n2=90n_2 = 90. Compute p^1\hat{p}_1, p^2\hat{p}_2, and the pooled proportion p^\hat{p} for testing H0:p1=p2H_0: p_1 = p_2.
  3. 3 For two independent samples, xˉ1xˉ2=5.2\bar{x}_1 - \bar{x}_2 = 5.2 and SE=1.6SE = 1.6. Using t=2.01t^* = 2.01, find the confidence interval for μ1μ2\mu_1 - \mu_2.
  4. 4 Explain why a two-sample t-test is usually more appropriate than a two-sample z-test when comparing the average test scores of two classes.