StatisticsComparing Two Groups5 of 6
Comparing Two Groups · 5

Two-Sample t-Test for a Difference in Means

When two groups have different sample averages, we need a way to tell whether that gap comes from a real difference between the groups or just the random luck of who ended up in each sample.

1

Measuring the Gap Against Random Bounce

We want to find out whether an observed gap between two sample averages, xˉ1−xˉ2\stat{\bar{x}_1} - \stat{\bar{x}_2}, is large compared to the random bounce we would expect if the two groups weren't truly different.

Suppose we split 2020 students randomly into two groups of 1010 to test a new study method against an old one:

Remember, each sample average has its own variance s2n\frac{\spread{s^2}}{n}, and we add the two variances together to measure the typical random bounce of the difference:

SE\displaystyle \spread{SE} =s12n1+s22n2\displaystyle = \sqrt{\frac{\spread{s_1^2}}{n_1} + \frac{\spread{s_2^2}}{n_2}}
The Two-Sample t-Statistic: Signal Over Noise
Group A\text{Group A}
new method\text{new method}
84\htmlClass{lc-blue}{84}
Group B\text{Group B}
old method\text{old method}
78\htmlClass{lc-blue}{78}
60\htmlClass{lc-mute}{60}
70\htmlClass{lc-mute}{70}
80\htmlClass{lc-mute}{80}
90\htmlClass{lc-mute}{90}
100\htmlClass{lc-mute}{100}
6\htmlClass{lc-blue}{6}
6-point gap: a real difference, or luck?\htmlClass{lc-blue}{6}\text{-point gap: a real difference, or luck?}
Text solution
Observed gap between the sample meansSubtract Group B's average from Group A's average to get the observed difference on top.
xˉ1−xˉ2\displaystyle \stat{\bar{x}_1} - \stat{\bar{x}_2} =84−78\displaystyle = \stat{84} - \stat{78} =6 points\displaystyle = \stat{6}\text{ points}
Standard error of the differenceAdd the variances of the two sample averages and take the square root to measure how far apart two random groups of 1010 typically land by luck alone.
SE=s12n1+s22n2=8210+6210=6.4+3.6=10≈3.16 points\displaystyle \begin{aligned} \spread{SE} &= \sqrt{\frac{\spread{s_1^2}}{n_1} + \frac{\spread{s_2^2}}{n_2}} \\ &= \sqrt{\frac{\spread{8^2}}{10} + \frac{\spread{6^2}}{10}} \\ &= \sqrt{\spread{6.4} + \spread{3.6}} = \sqrt{\spread{10}} \approx \spread{3.16}\text{ points} \end{aligned}
Two-sample t\steps{t}-statisticDivide the observed gap (compared to a null difference of 0\truth{0}) by the standard error to count how many standard errors apart the two sample averages are.
t\displaystyle \steps{t} =(84−78)−03.16\displaystyle = \frac{(\stat{84} - \stat{78}) - \truth{0}}{\spread{3.16}} =63.16≈1.90\displaystyle = \frac{\stat{6}}{\spread{3.16}} \approx \steps{1.90}

So the 6\stat{6}-point gap in favor of the new study method is 1.90\steps{1.90} standard errors away from 0\truth{0}.

t=(xˉ1−xˉ2)⏞observed gap (signal)−0⏞null values12n1+s22n2⏟standard error (noise)\displaystyle \boxed{\steps{t} = \frac{\overbrace{(\stat{\bar{x}_1} - \stat{\bar{x}_2})}^{\stat{\text{observed gap (signal)}}} - \overbrace{\truth{0}}^{\truth{\text{null value}}}}{\underbrace{\sqrt{\frac{\spread{s_1^2}}{n_1} + \frac{\spread{s_2^2}}{n_2}}}_{\spread{\text{standard error (noise)}}}}}

Even while the 6\stat{6}-point gap between the group averages stays at 84−78=6\stat{84} - \stat{78} = \stat{6}, smaller spreads within the two groups shrink the standard error and make t\steps{t} larger, while wide spreads make the standard error larger than the gap and push t\steps{t} toward 0\truth{0}.

Even when the gap between two group averages stays the same, tighter scores inside the groups shrink the random bounce and make that gap stand out more.
2

Turning t\steps{t} Into a p\share{p}-Value and Decision

Now we want to find the probability of getting a gap of 1.90\steps{1.90} standard errors or more in either direction just by luck when the two true population means, μ1\truth{\mu_1} and μ2\truth{\mu_2}, are equal. Because we estimated the unknown population standard deviations σ1\truth{\sigma_1} and σ2\truth{\sigma_2} using our sample standard deviations s1\spread{s_1} and s2\spread{s_2}, we check t=1.90\steps{t} = \steps{1.90} on a tt-distribution rather than a standard Normal curve.

Hypotheses, Degrees of Freedom, and the P-Value
t=63.16≈1.90\htmlClass{lc-pink}{t} = \dfrac{\htmlClass{lc-blue}{6}}{\htmlClass{lc-pink}{3.16}} \approx \htmlClass{lc-pink}{1.90}
p-value=  ?\htmlClass{lc-green}{p}\text{-value} = \;?
6\htmlClass{lc-blue}{6}
SE=3.16\htmlClass{lc-pink}{SE} = \htmlClass{lc-pink}{3.16}
1\htmlClass{lc-pink}{1}
1.90\htmlClass{lc-pink}{1.90}
−4\htmlClass{lc-mute}{-4}
−2\htmlClass{lc-mute}{-2}
0\htmlClass{lc-violet}{0}
2\htmlClass{lc-mute}{2}
4\htmlClass{lc-mute}{4}
6\htmlClass{lc-mute}{6}
8\htmlClass{lc-mute}{8}
10\htmlClass{lc-mute}{10}
12\htmlClass{lc-mute}{12}
Text solution
Null and alternative hypothesesState the claim of no difference between the true population means against a two-sided alternative.
H0:μ1−μ2=0(or μ1=μ2)Ha:μ1−μ2≠0(or μ1≠μ2)\displaystyle \begin{aligned} H_0&: \truth{\mu_1} - \truth{\mu_2} = \truth{0} \quad (\text{or } \truth{\mu_1} = \truth{\mu_2}) \\ H_a&: \truth{\mu_1} - \truth{\mu_2} \neq \truth{0} \quad (\text{or } \truth{\mu_1} \neq \truth{\mu_2}) \end{aligned}
Degrees of freedom (dfdf)Find the tt-curve using technology, or take the smaller of n1−1n_1 - 1 and n2−1n_2 - 1 when working by hand.
Technology:df≈16.7By hand (smaller of n1−1 and n2−1):df=10−1=9\displaystyle \begin{aligned} \text{Technology:}\quad df &\approx 16.7 \\ \text{By hand (smaller of } n_1 - 1 \text{ and } n_2 - 1\text{):}\quad df &= 10 - 1 = 9 \end{aligned}
Two-sided p\share{p}-value and decision at α=0.05\cutoff{\alpha} = \cutoff{0.05}Add the area in both tails beyond t=−1.90\steps{t} = \steps{-1.90} and t=1.90\steps{t} = \steps{1.90}, then compare that p\share{p}-value to the α=0.05\cutoff{\alpha} = \cutoff{0.05} cutoff.
p=P(∣t∣≥1.90)=0.075>0.05(by hand with df=9: p≈0.090>0.05)\displaystyle \begin{aligned} \share{p} &= P(|\steps{t}| \ge \steps{1.90}) = \share{0.075} > \cutoff{0.05} \\ (\text{by hand with } df = 9\text{: } \share{p} &\approx \share{0.090} > \cutoff{0.05}) \end{aligned}
df=16.7df = 16.7
α=0.05\htmlClass{lc-orange}{\alpha} = \htmlClass{lc-orange}{0.05}
0.0376\htmlClass{lc-green}{0.0376}
0.0376\htmlClass{lc-green}{0.0376}
−1.90\htmlClass{lc-pink}{-1.90}
0\htmlClass{lc-violet}{0}
1.90\htmlClass{lc-pink}{1.90}
p=0.0376+0.0376≈0.075\htmlClass{lc-green}{p} = \htmlClass{lc-green}{0.0376} + \htmlClass{lc-green}{0.0376} \approx \htmlClass{lc-green}{0.075}

If H0H_0 is true, a gap of 6\stat{6} points or more in either direction would happen about 7.5%\share{7.5\%} of the time by random luck alone. Because p=0.075\share{p} = \share{0.075} is greater than α=0.05\cutoff{\alpha} = \cutoff{0.05}, we fail to reject H0H_0.

Practical note: Technology and the by-hand rule give different degrees of freedom (16.716.7 vs. 99) and slightly different p\share{p}-values (0.075\share{0.075} vs. 0.090\share{0.090}). Always write your dfdf right next to your t\steps{t}-statistic so it is clear which tt-curve your p\share{p}-value came from.

3

How Sample Size Changes the Test

Suppose we observed the exact same group averages (xˉ1=84\stat{\bar{x}_1} = \stat{84} and xˉ2=78\stat{\bar{x}_2} = \stat{78}) and the exact same sample standard deviations (s1=8\spread{s_1} = \spread{8} and s2=6\spread{s_2} = \spread{6}), but we tested n1=40n_1 = 40 and n2=40n_2 = 40 students per group instead of 1010. We want to see how multiplying the sample size by 44 changes the standard error, t\steps{t}-statistic, and conclusion.

How Sample Size Changes the Test
Group A\text{Group A}
84\htmlClass{lc-blue}{84}
s1\htmlClass{lc-pink}{s_1}
=8{} = \htmlClass{lc-pink}{8}
Group B\text{Group B}
78\htmlClass{lc-blue}{78}
s2\htmlClass{lc-pink}{s_2}
=6{} = \htmlClass{lc-pink}{6}
70\htmlClass{lc-mute}{70}
80\htmlClass{lc-mute}{80}
90\htmlClass{lc-mute}{90}
100\htmlClass{lc-mute}{100}
n1=n2=10 ⁣:n_1 = n_2 = 10\!:
t≈1.90\htmlClass{lc-pink}{t} \approx \htmlClass{lc-pink}{1.90}
n1=n2=40 ⁣:n_1 = n_2 = 40\!:
t=  ?\htmlClass{lc-pink}{t} = \;?
Text solution
New standard error with n1=40n_1 = 40 and n2=40n_2 = 40Divide each group's variance by 4040 instead of 1010, which cuts the standard error in half.
SE=8240+6240=6440+3640=10040=2.5≈1.58 points\displaystyle \begin{aligned} \spread{SE} &= \sqrt{\frac{\spread{8^2}}{40} + \frac{\spread{6^2}}{40}} = \sqrt{\frac{\spread{64}}{40} + \frac{\spread{36}}{40}} \\ &= \sqrt{\frac{\spread{100}}{40}} = \sqrt{\spread{2.5}} \approx \spread{1.58}\text{ points} \end{aligned}
New t\steps{t}-statisticDivide the same 6\stat{6}-point gap by the smaller standard error, doubling t\steps{t}.
t\displaystyle \steps{t} =6−01.58≈3.80\displaystyle = \frac{\stat{6} - \truth{0}}{\spread{1.58}} \approx \steps{3.80}
Two-sided p\share{p}-value and decisionCheck t=3.80\steps{t} = \steps{3.80} in both tails against α=0.05\cutoff{\alpha} = \cutoff{0.05}.
p≈0.0003<0.05(with df≈72.3;by hand with df=39: p≈0.0005<0.05)\displaystyle \begin{aligned} \share{p} &\approx \share{0.0003} < \cutoff{0.05} \quad (\text{with } df \approx 72.3\text{;} \\ \text{by hand with } df = 39\text{: } \share{p} &\approx \share{0.0005} < \cutoff{0.05}) \end{aligned}
n1=n2=10n_1 = n_2 = 10
6\htmlClass{lc-blue}{6}
SE=3.16\htmlClass{lc-pink}{SE} = \htmlClass{lc-pink}{3.16}
1\htmlClass{lc-pink}{1}
t=1.90\htmlClass{lc-pink}{t} = \htmlClass{lc-pink}{1.90}
n1=n2=40n_1 = n_2 = 40
6\htmlClass{lc-blue}{6}
SE=1.58\htmlClass{lc-pink}{SE} = \htmlClass{lc-pink}{1.58}
1\htmlClass{lc-pink}{1}
2\htmlClass{lc-pink}{2}
3\htmlClass{lc-pink}{3}
t=3.80\htmlClass{lc-pink}{t} = \htmlClass{lc-pink}{3.80}
0\htmlClass{lc-violet}{0}
1\htmlClass{lc-mute}{1}
2\htmlClass{lc-mute}{2}
3\htmlClass{lc-mute}{3}
4\htmlClass{lc-mute}{4}
5\htmlClass{lc-mute}{5}
6\htmlClass{lc-mute}{6}
7\htmlClass{lc-mute}{7}
points\htmlClass{lc-mute}{\text{points}}

So with 4040 students per group, the same 6\stat{6}-point gap is 3.80\steps{3.80} standard errors away from 0\truth{0}, giving convincing statistical evidence to reject H0H_0.

4

Connecting the Test to a Confidence Interval

A 95%\share{95\%} confidence interval for μ1−μ2\truth{\mu_1} - \truth{\mu_2} gives all plausible values for the true difference using the exact same sample gap and standard error as the test:

(xˉ1−xˉ2)⏟estimate±t∗s12n1+s22n2⏟standard error\displaystyle \underbrace{(\stat{\bar{x}_1} - \stat{\bar{x}_2})}_{\stat{\text{estimate}}} \pm \cutoff{t^*} \underbrace{\sqrt{\frac{\spread{s_1^2}}{n_1} + \frac{\spread{s_2^2}}{n_2}}}_{\spread{\text{standard error}}}

We want to see how the 95%\share{95\%} confidence interval for our original 1010-student groups (df≈16.7df \approx 16.7, where t∗=2.11\cutoff{t^*} = \cutoff{2.11}) shows the same result as our two-sided test at α=0.05\cutoff{\alpha} = \cutoff{0.05}.

Connecting the Test to a Confidence Interval
estimate±t∗×SE\htmlClass{lc-blue}{\text{estimate}} \pm \htmlClass{lc-orange}{t^*} \times \htmlClass{lc-pink}{SE}
estimate\htmlClass{lc-blue}{\text{estimate}}
=6{} = \htmlClass{lc-blue}{6}
SE\htmlClass{lc-pink}{SE}
≈3.16{} \approx \htmlClass{lc-pink}{3.16}
95% interval\htmlClass{lc-green}{95\%}\text{ interval}
=(  ?  ,  ?  ){} = (\;?\;,\;?\;)
−2\htmlClass{lc-mute}{-2}
0\htmlClass{lc-violet}{0}
2\htmlClass{lc-mute}{2}
4\htmlClass{lc-mute}{4}
6\htmlClass{lc-mute}{6}
8\htmlClass{lc-mute}{8}
10\htmlClass{lc-mute}{10}
12\htmlClass{lc-mute}{12}
14\htmlClass{lc-mute}{14}
Text solution
Margin of error for 95%\share{95\%} confidenceMultiply the critical value t∗=2.11\cutoff{t^*} = \cutoff{2.11} (for df≈16.7df \approx 16.7) by the standard error of 3.16\spread{3.16} points.
t∗×SE\displaystyle \cutoff{t^*} \times \spread{SE} =2.11×3.16≈6.67 points\displaystyle = \cutoff{2.11} \times \spread{3.16} \approx \spread{6.67}\text{ points}
95%\share{95\%} confidence interval for μ1−μ2\truth{\mu_1} - \truth{\mu_2}Add and subtract the margin of error from the 6\stat{6}-point sample difference.
6±6.67\displaystyle \stat{6} \pm \spread{6.67} =(−0.67, 12.67) points\displaystyle = (-0.67, \, 12.67)\text{ points}

Because 0\truth{0} sits inside (−0.67, 12.67)(-0.67, \, 12.67), a true difference of 0\truth{0} is plausible at the 95%\share{95\%} confidence level, which matches our two-sided test failing to reject H0H_0 at α=0.05\cutoff{\alpha} = \cutoff{0.05}.

When the group spreads and sample sizes stay the same, whenever the 95%\share{95\%} confidence interval around xˉ1−xˉ2\stat{\bar{x}_1} - \stat{\bar{x}_2} includes 0\truth{0}, the two-sided p\share{p}-value is greater than 0.05\cutoff{0.05}. Right as the edge of the interval moves past 0\truth{0}, ∣t∣|\steps{t}| passes t∗\cutoff{t^*} and the p\share{p}-value drops below 0.05\cutoff{0.05}.

As long as the 95% confidence interval covers 0, the two-tailed p-value stays above 0.05, and the exact instant the interval moves completely past 0, the test statistic crosses the cutoff and the p-value drops below 0.05.
5

Checking Conditions Before Running the Test

Before trusting a tt-distribution to give an accurate p\share{p}-value, we check that the data meet three conditions: Random, Independent, and Normal / Large Sample.

Conditions for a Two-Sample t-Test
t=63.16≈1.90\htmlClass{lc-pink}{t} = \dfrac{\htmlClass{lc-blue}{6}}{\htmlClass{lc-pink}{3.16}} \approx \htmlClass{lc-pink}{1.90}
Random\text{Random}
Independent\text{Independent}
Normal / Large Sample\text{Normal / Large Sample}
n1<10% of Population 1andn2<10% of Population 2\displaystyle \begin{aligned} n_1 &< 10\%\text{ of Population 1} \quad \text{and} \\ n_2 &< 10\%\text{ of Population 2} \end{aligned}
Safe to use t\text{Safe to use } t
Group 1\text{Group 1}
xˉ1\htmlClass{lc-blue}{\bar{x}_1}
Group 2\text{Group 2}
xˉ2\htmlClass{lc-blue}{\bar{x}_2}
60\htmlClass{lc-mute}{60}
70\htmlClass{lc-mute}{70}
80\htmlClass{lc-mute}{80}
90\htmlClass{lc-mute}{90}
100\htmlClass{lc-mute}{100}
110\htmlClass{lc-mute}{110}
120\htmlClass{lc-mute}{120}
130\htmlClass{lc-mute}{130}
Not safe for small-sample t\text{Not safe for small-sample } t
outlier\htmlClass{lc-orange}{\text{outlier}}
Group 1\text{Group 1}
xˉ1\htmlClass{lc-blue}{\bar{x}_1}
Group 2\text{Group 2}
xˉ2\htmlClass{lc-blue}{\bar{x}_2}
60\htmlClass{lc-mute}{60}
70\htmlClass{lc-mute}{70}
80\htmlClass{lc-mute}{80}
90\htmlClass{lc-mute}{90}
100\htmlClass{lc-mute}{100}
110\htmlClass{lc-mute}{110}
120\htmlClass{lc-mute}{120}
130\htmlClass{lc-mute}{130}

Key concepts

Use a Two-Sample tt-Test for a Difference in Means when you want to test whether two true population means differ (H0:μ1−μ2=0H_0: \truth{\mu_1} - \truth{\mu_2} = \truth{0}) using sample means xˉ1,xˉ2\stat{\bar{x}_1}, \stat{\bar{x}_2} and sample standard deviations s1,s2\spread{s_1}, \spread{s_2} from two separate groups. Do not use a Two-Sample tt-Test when the two sets of measurements come from the same individuals (for example, 3535 athletes timed before and after a warm-up routine); linked observations must be analyzed with a Paired tt-Test.

Before computing t\steps{t}, check three conditions:

Random

Random assignment in an experiment or two independent random samples.

Independent

Separate groups, plus n1<10%n_1 < 10\% of Population 1 and n2<10%n_2 < 10\% of Population 2 whenever sampling without replacement.

Normal / Large Sample

Both n1≥30n_1 \ge 30 and n2≥30n_2 \ge 30, normal populations, or small-sample graphs with no strong skewness or extreme outliers.

When the conditions hold, compare the observed gap to the standard error by subtracting the sample averages on top and adding their sample-mean variances on the bottom:

t=(xˉ1−xˉ2)−0s12n1+s22n2\displaystyle {\steps{t} = \frac{(\stat{\bar{x}_1} - \stat{\bar{x}_2}) - \truth{0}}{\sqrt{\dfrac{\spread{s_1^2}}{n_1} + \dfrac{\spread{s_2^2}}{n_2}}}}

For example, with xˉ1=84,s1=8,n1=10\stat{\bar{x}_1} = \stat{84}, \spread{s_1} = \spread{8}, n_1 = 10 and xˉ2=78,s2=6,n2=10\stat{\bar{x}_2} = \stat{78}, \spread{s_2} = \spread{6}, n_2 = 10, the gap is 84−78=6\stat{84} - \stat{78} = \stat{6} and the standard error is 8210+6210≈3.16\sqrt{\tfrac{\spread{8^2}}{10} + \tfrac{\spread{6^2}}{10}} \approx \spread{3.16}, giving t=63.16≈1.90\steps{t} = \tfrac{\stat{6}}{\spread{3.16}} \approx \steps{1.90}. Look up t\steps{t} on the tt-curve using the dfdf from technology or the conservative by-hand rule, the smaller of n1−1n_1 - 1 and n2−1n_2 - 1. For a two-sided test at α=0.05\cutoff{\alpha} = \cutoff{0.05}, you reject H0H_0 (p<0.05\share{p} < \cutoff{0.05}) whenever ∣t∣>t∗|\steps{t}| > \cutoff{t^*}, which is the exact same condition as 0\truth{0} falling outside the 95%\share{95\%} confidence interval (xˉ1−xˉ2)±t∗SE(\stat{\bar{x}_1} - \stat{\bar{x}_2}) \pm \cutoff{t^*} \spread{SE}.

6

Practice

1

To test whether two reading programs produce different average comprehension scores, a researcher selects two independent random samples of students. Group 1 (Program A) has n1=16n_1 = 16 students with sample mean xˉ1=61\stat{\bar{x}_1} = \stat{61} points and sample standard deviation s1=12\spread{s_1} = \spread{12} points. Group 2 (Program B) has n2=25n_2 = 25 students with sample mean xˉ2=50\stat{\bar{x}_2} = \stat{50} points and sample standard deviation s2=20\spread{s_2} = \spread{20} points. State the null and alternative hypotheses for a two-sided test, calculate the standard error, the test statistic t\steps{t}, and the conservative degrees of freedom by hand, and explain in plain English what the standard error and t\steps{t}-statistic mean in this context.

Find each group's sample-mean variance s2n\frac{\spread{s^2}}{n} first, add them to find the standard error, and check which group has the smaller sample size for dfdf.

Hypotheses
H0:μ1−μ2=0 (or μ1=μ2)andHa:μ1−μ2≠0 (or μ1≠μ2)\displaystyle \begin{aligned} H_0&: \truth{\mu_1} - \truth{\mu_2} = \truth{0} \text{ (or } \truth{\mu_1} = \truth{\mu_2}\text{)} \quad \text{and} \\ H_a&: \truth{\mu_1} - \truth{\mu_2} \neq \truth{0} \text{ (or } \truth{\mu_1} \neq \truth{\mu_2}\text{)} \end{aligned}
where μ1\truth{\mu_1} and μ2\truth{\mu_2} are the true population mean comprehension scores for Programs A and B.
Standard error
SE=s12n1+s22n2=12216+20225=9+16=25=5 points\displaystyle \begin{aligned} \spread{SE} &= \sqrt{\frac{\spread{s_1^2}}{n_1} + \frac{\spread{s_2^2}}{n_2}} = \sqrt{\frac{\spread{12^2}}{16} + \frac{\spread{20^2}}{25}} \\ &= \sqrt{\spread{9} + \spread{16}} = \sqrt{\spread{25}} = \spread{5}\text{ points} \end{aligned}
(Watch out: subtracting the variances inside the root gives ∣9−16∣=7≈2.65\sqrt{|\spread{9} - \spread{16}|} = \sqrt{7} \approx 2.65 and t≈4.16\steps{t} \approx 4.16, and forgetting to take the square root at the end leaves SE=25\spread{SE} = 25 and t=1125=0.44\steps{t} = \tfrac{\stat{11}}{25} = 0.44.)
Test statistic
t\displaystyle \steps{t} =(61−50)−05\displaystyle = \frac{(\stat{61} - \stat{50}) - \truth{0}}{\spread{5}} =115\displaystyle = \frac{\stat{11}}{\spread{5}} =2.20\displaystyle = \steps{2.20}
Conservative degrees of freedom by handTake the smaller of n1−1=15n_1 - 1 = 15 and n2−1=24n_2 - 1 = 24, which gives df=15df = 15. (Watch out: picking the larger value gives df=24df = 24, and adding 16+25−216 + 25 - 2 gives df=39df = 39.)
Plain-English meaningSE=5\spread{SE} = \spread{5} points means that if the two reading programs had the exact same true average score, random samples of 1616 and 2525 students would typically have sample averages that land about 5\spread{5} points apart just by luck; t=2.20\steps{t} = \steps{2.20} means the observed 11\stat{11}-point gap between the two sample averages is 2.20\steps{2.20} standard errors away from 0\truth{0}.
2

An industrial engineer tests whether two assembly methods differ in average completion time (μ1\truth{\mu_1} and μ2\truth{\mu_2}, in minutes). Using two independent random samples, the observed difference is xˉ1−xˉ2=−4.2\stat{\bar{x}_1} - \stat{\bar{x}_2} = \stat{-4.2} minutes, giving a test statistic of t=−1.85\steps{t} = \steps{-1.85} and a two-sided p\share{p}-value of 0.068\share{0.068}. (a) Interpret the p\share{p}-value of 0.068\share{0.068} in context. (b) State the decision and conclusion at the α=0.05\cutoff{\alpha} = \cutoff{0.05} significance level. (c) Explain why the standard error in the denominator adds the two sample variances (s12n1+s22n2\frac{\spread{s_1^2}}{n_1} + \frac{\spread{s_2^2}}{n_2}) even though the numerator subtracts the two sample averages (xˉ1−xˉ2\stat{\bar{x}_1} - \stat{\bar{x}_2}).

A p\share{p}-value starts by assuming H0H_0 is true; for part (c), think about what happens to the gap between the two sample averages if one bounces up while the other bounces down.

(a)Assuming the two assembly methods have the exact same true mean completion time (H0:μ1−μ2=0H_0: \truth{\mu_1} - \truth{\mu_2} = \truth{0} is true), there is a 0.068\share{0.068} (6.8%\share{6.8\%}) probability of getting a sample mean difference of 4.2\stat{4.2} minutes or more in either direction just by random luck. (Watch out: do not say there is a 6.8%\share{6.8\%} probability that H0H_0 is true. The p\share{p}-value is the probability of the sample result given H0H_0, not the probability of H0H_0 itself.)
(b)Because p=0.068>α=0.05\share{p} = \share{0.068} > \cutoff{\alpha} = \cutoff{0.05}, fail to reject H0H_0; there is not convincing statistical evidence that the true mean completion times differ between the two assembly methods. (Watch out: misreading 0.068\share{0.068} as smaller than 0.05\cutoff{0.05}, like 0.00680.0068, leads to the wrong decision of rejecting H0H_0.)
(c)Both sample averages bounce randomly on their own. If Group 1's average randomly bounces one way while Group 2's average bounces the other way, the gap between them stretches from both ends, so the random variation from both groups adds to the total uncertainty.
3

In a pilot study comparing blood pressure reduction (in mmHg) for two medications, 99 patients are randomly assigned to Group 1 and 99 patients to Group 2. Group 1 has xˉ1=18 mmHg\stat{\bar{x}_1} = \stat{18}\text{ mmHg} and s1=9 mmHg\spread{s_1} = \spread{9}\text{ mmHg}; Group 2 has xˉ2=10 mmHg\stat{\bar{x}_2} = \stat{10}\text{ mmHg} and s2=12 mmHg\spread{s_2} = \spread{12}\text{ mmHg}. This gives SE=929+1229=5 mmHg\spread{SE} = \sqrt{\tfrac{\spread{9^2}}{9} + \tfrac{\spread{12^2}}{9}} = \spread{5}\text{ mmHg} and t=8−05=1.60\steps{t} = \tfrac{\stat{8} - \truth{0}}{\spread{5}} = \steps{1.60}, with a two-sided p\share{p}-value of 0.13\share{0.13}, failing to reject H0H_0 at α=0.05\cutoff{\alpha} = \cutoff{0.05}. Suppose a larger clinical trial tests n1=81n_1 = 81 and n2=81n_2 = 81 patients per group and gets the exact same sample means (18\stat{18} and 10 mmHg\stat{10}\text{ mmHg}) and sample standard deviations (9\spread{9} and 12 mmHg\spread{12}\text{ mmHg}). Find the new standard error and t\steps{t}-statistic, and explain why the conclusion at α=0.05\cutoff{\alpha} = \cutoff{0.05} changes even though the 8-mmHg\stat{8}\text{-mmHg} gap and sample standard deviations stayed the same.

Check how multiplying both sample sizes by 99 inside the square root affects the denominator of t\steps{t}.

New standard error
SE=9281+12281=1+169=259=53≈1.67 mmHg\displaystyle \begin{aligned} \spread{SE} &= \sqrt{\frac{\spread{9^2}}{81} + \frac{\spread{12^2}}{81}} = \sqrt{\spread{1} + \spread{\frac{16}{9}}} \\ &= \sqrt{\spread{\frac{25}{9}}} = \spread{\frac{5}{3}} \approx \spread{1.67}\text{ mmHg} \end{aligned}
(Watch out: dividing the old standard error by 99 instead of 9=3\sqrt{9} = 3 forgets the square root over nn and gives the wrong answers SE=59≈0.56 mmHg\spread{SE} = \tfrac{5}{9} \approx 0.56\text{ mmHg} and t=14.40\steps{t} = 14.40.)
New test statistic
t\displaystyle \steps{t} =8−053\displaystyle = \frac{\stat{8} - \truth{0}}{\spread{\tfrac{5}{3}}} =4.80\displaystyle = \steps{4.80}
Why the conclusion changesMultiplying the sample size by 99 cut the standard error to one-third of its former size (1.67 mmHg\spread{1.67}\text{ mmHg} instead of 5 mmHg\spread{5}\text{ mmHg}), making the same 8-mmHg\stat{8}\text{-mmHg} gap stand out as 4.80\steps{4.80} standard errors instead of 1.60\steps{1.60}. With t=4.80\steps{t} = \steps{4.80}, the two-sided p\share{p}-value is far below 0.05\cutoff{0.05}, so we now reject H0H_0.
4

In an experiment comparing battery life (in hours) for two phone settings with n1=12n_1 = 12 and n2=12n_2 = 12 phones, the sample difference is xˉ1−xˉ2=3.21 hours\stat{\bar{x}_1} - \stat{\bar{x}_2} = \stat{3.21}\text{ hours} and the standard error is SE=1.50 hours\spread{SE} = \spread{1.50}\text{ hours}. For a 95%\share{95\%} confidence interval, technology (df≈20.4df \approx 20.4) gives critical value t∗=2.08\cutoff{t^*} = \cutoff{2.08}, while the conservative by-hand rule (df=11df = 11) gives t∗=2.20\cutoff{t^*} = \cutoff{2.20}. Construct both 95%\share{95\%} confidence intervals, use them to determine whether the two-sided p\share{p}-value for H0:μ1−μ2=0H_0: \truth{\mu_1} - \truth{\mu_2} = \truth{0} is above or below α=0.05\cutoff{\alpha} = \cutoff{0.05} under each method, and explain why the two methods disagree here.

Compute 3.21±t∗(1.50)\stat{3.21} \pm \cutoff{t^*}(\spread{1.50}) for each critical value, then check whether the null value 0\truth{0} lands inside or outside each interval.

Technology 95%\share{95\%} confidence interval (df≈20.4df \approx 20.4)
3.21±2.08(1.50)\displaystyle \stat{3.21} \pm \cutoff{2.08}(\spread{1.50}) =3.21±3.12\displaystyle = \stat{3.21} \pm \spread{3.12} =(0.09, 6.33) hours\displaystyle = (0.09, \, 6.33)\text{ hours}
Because 0\truth{0} is outside (0.09, 6.33)(0.09, \, 6.33), the technology two-sided p\share{p}-value is less than 0.05\cutoff{0.05} (reject H0H_0).
By-hand 95%\share{95\%} confidence interval (df=11df = 11)
3.21±2.20(1.50)\displaystyle \stat{3.21} \pm \cutoff{2.20}(\spread{1.50}) =3.21±3.30\displaystyle = \stat{3.21} \pm \spread{3.30} =(−0.09, 6.51) hours\displaystyle = (-0.09, \, 6.51)\text{ hours}
(Watch out: forgetting to multiply t∗\cutoff{t^*} by SE=1.50\spread{SE} = \spread{1.50} gives 3.21±2.08=(1.13, 5.29)\stat{3.21} \pm \cutoff{2.08} = (1.13, \, 5.29) and 3.21±2.20=(1.01, 5.41)\stat{3.21} \pm \cutoff{2.20} = (1.01, \, 5.41), which misses the disagreement completely. Also, remember that 0\truth{0} inside the interval means 0\truth{0} is plausible, so p>0.05\share{p} > \cutoff{0.05}, not p<0.05\share{p} < \cutoff{0.05}.) Because 0\truth{0} is inside (−0.09, 6.51)(-0.09, \, 6.51), the conservative by-hand two-sided p\share{p}-value is greater than 0.05\cutoff{0.05} (fail to reject H0H_0).
Why they disagreeThe test statistic here is t=3.211.50=2.14\steps{t} = \tfrac{\stat{3.21}}{\spread{1.50}} = \steps{2.14}, which lands right between the two cutoffs t∗=2.08\cutoff{t^*} = \cutoff{2.08} and t∗=2.20\cutoff{t^*} = \cutoff{2.20}. The cutoffs differ because the conservative df=11df = 11 curve has slightly heavier tails than the technology df≈20.4df \approx 20.4 curve, which gives a wider interval and a slightly larger p\share{p}-value.
5

For each study below, determine whether all conditions for a Two-Sample tt-Test are met, and if not, identify the specific condition that fails. (a) A principal takes a random sample of 4040 seniors from a high school of 250250 seniors and an independent random sample of 4040 seniors from a rival high school of 900900 seniors to compare mean SAT math scores. (b) A coach selects a random sample of 3535 college athletes and records each athlete's sprint time before a new warm-up routine and again after using the routine to test whether mean sprint time changed. (c) A botanist randomly assigns 2424 seedlings into two groups of 1212 (one receiving a new plant food, one receiving water only) and measures height after three weeks; dotplots of the 1212 heights in each group are roughly symmetric with no outliers.

Check Random, Independent (both separate groups and the 10%10\% rule when sampling without replacement), and Normal / Large Sample in turn.

(a)Fails the Independent (10%10\%) condition: when sampling without replacement, 4040 seniors is more than 10%10\% of the first high school's population of 250250 seniors (10%10\% of 250=25250 = 25). (Watch out: seeing n1=40≥30n_1 = 40 \ge 30 and n2=40≥30n_2 = 40 \ge 30 only satisfies the Normal / Large Sample condition; you still have to check the 10%10\% rule when sampling from a finite population.)
(b)Fails the Independent Groups condition: the before-and-after sprint times are measured on the exact same 3535 athletes, so the two sets of scores are linked and require a Paired tt-Test rather than a Two-Sample tt-Test. (Watch out: a large sample size of n=35≥30n = 35 \ge 30 does not turn paired measurements on the same people into two independent groups.)
(c)All conditions are met: Random is met by random assignment of the 2424 seedlings; Independent is met because the two groups are separate and there is no sampling without replacement from a finite population; Normal / Large Sample is met for the small samples (n1=12,n2=12n_1 = 12, n_2 = 12) because the dotplots of both groups show no strong skewness or extreme outliers. (Watch out: n1=12<30n_1 = 12 < 30 and n2=12<30n_2 = 12 < 30 does not fail the Normal condition when the sample graphs are roughly symmetric with no outliers.)