Sampling Distributions for Differences
AP Statistics · Unit 3 — Inference for Categorical Data: Proportions
Two independent samples
Comparing two groups means studying the difference of two statistics. When the samples are independent, the centre of the difference is the difference of centres, and — because variances of independent quantities add — the spread combines by adding variances, because the two samples are independent:
$$\mu_{\hat p_1-\hat p_2}=p_1-p_2,\qquad \sigma_{\hat p_1-\hat p_2}=\sqrt{\frac{p_1(1-p_1)}{n_1}+\frac{p_2(1-p_2)}{n_2}}$$$$\mu_{\bar x_1-\bar x_2}=\mu_1-\mu_2,\qquad \sigma_{\bar x_1-\bar x_2}=\sqrt{\frac{\sigma_1^2}{n_1}+\frac{\sigma_2^2}{n_2}}$$The plus sign under the root is not a typo: subtracting two noisy quantities makes the result noisier, not calmer.
Shape and conditions
The difference of proportions is approximately normal when each sample passes the large-counts check: $n_1p_1$, $n_1(1-p_1)$, $n_2p_2$, $n_2(1-p_2)$ all at least $10$. The difference of means is normal if both populations are normal, or approximately normal by the CLT when both $n_1$ and $n_2$ are at least $30$. Each sample also needs its own $10\%$ condition. Independence between the two samples is essential — paired data (before/after on the same people) does not use these formulas.
A numeric check
Suppose $p_1=0{,}40$ with $n_1=100$ and $p_2=0{,}30$ with $n_2=150$. Then $\sigma_{\hat p_1-\hat p_2}=\sqrt{\frac{0{,}24}{100}+\frac{0{,}21}{150}}=\sqrt{0{,}0024+0{,}0014}\approx0{,}062$, so a sample difference of $0{,}18$ is $z=\frac{0{,}18-0{,}10}{0{,}062}\approx1{,}3$ standard errors above its mean.
Worked example: probability for a difference of two sample means
Reading scores of students at school X have $\mu_1=520$, $\sigma_1=60$; at school Y, $\mu_2=500$, $\sigma_2=80$. $40$ students are chosen at random and independently from each school. What is the probability that the sample mean of school Y is higher than the sample mean of school X?
Solution
Conditions: two random samples, independent of each other; $n_1=n_2=40\ge30$ so by the CLT $\bar x_1-\bar x_2$ is approximately normal; assume each school has more than $400$ students (the $10\%$ condition).
Sampling distribution of $\bar x_1-\bar x_2$: center $520-500=20$; standard error
$$\sqrt{\frac{60^2}{40}+\frac{80^2}{40}}=\sqrt{90+160}=\sqrt{250}\approx15.8$$Calculation: Y higher than X means $\bar x_1-\bar x_2\lt0$:
$$z=\frac{0-20}{15.8}\approx-1.27,\qquad P(z\lt-1.27)\approx0.102$$Conclusion: although school X averages $20$ points higher, there is still about a $10\%$ chance that a sample of $40$ students from school Y has a higher mean. The key point: add $90+160$ under the root; anyone who takes $\sqrt{160-90}$ or $\dfrac{60+80}{\sqrt{40}}$ gets the standard error wrong.