The last topic described how varies when the population standard deviations are known. In practice they are not, so, exactly as for one mean, we estimate them with the sample standard deviations and switch from to . The result is the two-sample t interval.
The interval
Replace and with and in the standard deviation of . That gives the standard error
and the interval has the familiar form, statistic plus or minus critical value times standard error:
The parameter is , the difference in true means. Always say which group is "1": the order of subtraction decides the sign of every value in the interval. Reversing the order flips the interval: from 2.1 to 6.5 for becomes from to for .
Degrees of freedom: two accepted choices
For two samples, the t distribution that fits is only approximate, and its degrees of freedom come from a long formula (the Welch formula) that technology computes for you. It is usually not a whole number. If you are using Table B instead, the safe choice is the conservative degrees of freedom, the smaller of and .
| Choice | Spaced versus massed example | Effect |
|---|---|---|
| Technology (Welch) df | df = 25.6, | the more accurate interval |
| Conservative df, smaller | df = 13, | slightly wider: at least the stated confidence |
Both are accepted on the exam. Say which you used.
Conditions, for each group
- Random: two independent random samples, or two groups formed by random assignment in an experiment.
- 10%: when sampling without replacement, each sample is less than 10% of its own population. (Not needed for random assignment.)
- Normal/large sample: for each group, the population is normal, or , or a graph of that group's data shows no strong skew and no outliers.
Independence between the groups matters too. If the same people are measured twice, or the units come in matched pairs, the data are paired: use the differences and a one-sample t interval instead.
Worked example 1 (an experiment). Twenty-eight volunteers were randomly assigned, 14 each, to spaced practice or massed practice for learning 50 words (invented data). Recall a week later: spaced , ; massed , . Boxplots of both groups are roughly symmetric with no outliers. Construct a 95% confidence interval for .
Procedure: a two-sample t interval for , the true mean recall with spaced practice minus with massed practice, for volunteers like these.
Conditions. Random: the volunteers were randomly assigned to the two methods. 10%: not needed, since there was no sampling from a population. Normal/large sample: both groups have , but neither boxplot shows strong skew or outliers.
Expression and substitution:
Answer: from 0.61 to 10.81 words. (With the conservative df 13: , from 0.35 to 11.07 words.)
Interpretation: We are 95% confident that the interval from 0.61 to 10.81 words captures the true difference in mean recall (spaced minus massed) for volunteers like these.
Because the groups were formed by random assignment, a difference here can be credited to the practice method. Because the volunteers were not a random sample, the result applies to volunteers like these, not to all students.
Worked example 2 (an observational study). Independent random samples of drivers in two large cities: city 1, , minutes, ; city 2, , , . Both samples are large () and small shares of each city's commuters. Construct a 95% interval for .
Interpretation: We are 95% confident that the interval from to 9.63 minutes captures the true difference in mean commute time (city 1 minus city 2) for drivers in these two cities.
This study can generalize to drivers in the two cities, since the samples were random. It cannot say that living in city 1 causes longer commutes: there was no random assignment, and the cities differ in many ways.
Common slips
- Adding standard errors: is too large. Add the variances inside one square root.
- Using because the samples are large. With and in the formula, use .
- Checking the normal/large sample condition on the combined data. Check each group.
- Analyzing paired data as two samples, or two independent samples as pairs.