This is the last procedure of Unit 4, and it reuses everything before it: the standard error of a difference from the two-sample interval, the logic of a significance test from the one-sample t test, and the setup from the previous topic. What is new is one formula, the two-sample t statistic, and the habit of choosing among all the procedures you now know.
The two-sample t statistic
Assume is true: the true means are equal, so . Then the difference in sample means, , varies around 0 with standard error . Measure the observed difference in standard errors:
This is the two-sample t statistic. Its p-value comes from a t distribution with the technology (Welch) degrees of freedom, or with the conservative df, the smaller of and . The conservative choice gives a slightly larger p-value; both are accepted.
A complete test
Worked example 1. Forty-two volunteers were randomly assigned to a caffeinated drink (C, ) or a caffeine-free look-alike (N, ), then did a reaction-time task (invented data). Caffeine: ms, ; no caffeine: ms, . Dotplots of both groups show no strong skew or outliers. Is there convincing evidence at that caffeine lowers mean reaction time?
State. , , where and are the true mean reaction times with and without caffeine for adults like these volunteers.
Plan. Two-sample t test. Random: random assignment to the two drinks. 10%: not needed for an experiment. Normal/large sample: both groups are under 30, but neither dotplot shows strong skew or outliers.
Do.
Conclude. Because the p-value of 0.0132 is less than 0.05, we reject the null hypothesis. There is convincing evidence that the true mean reaction time with caffeine is less than without caffeine, for adults like these.
Scope. The drinks were randomly assigned, so the faster reactions can be credited to caffeine. The volunteers were not a random sample, so the result applies to adults like them.
Worked example 2 (two-sided, fail to reject). Independent random samples of adults in two large counties: county 1, , hours of exercise last week, ; county 2, , , . Test against at .
Conditions: independent random samples; each is less than 10% of its county's adults; both .
Because the p-value of 0.274 is greater than 0.05, we fail to reject the null hypothesis. There is not convincing evidence that the true mean weekly exercise hours of adults differ between the two counties.
The p-value in context: Assuming there is no difference in the true mean weekly exercise hours of the two counties, there is a 0.274 probability of getting a difference in sample means of 0.7 hours or more in either direction by chance, with random samples of 45 and 50 adults.
Having failed to reject, the department might have made a Type II error: the true means could differ by an amount these samples could not detect. A rejection, like the caffeine result, risks a Type I error instead.
Choosing the inference procedure
Unit 3 and Unit 4 together give you a small family of procedures. Three questions pick the right one.
| Question | If | Then |
|---|---|---|
| 1. What is the response? | categorical (yes or no) | proportions: z procedures |
| categorical with several categories, in a two-way table | chi-square test for homogeneity or independence (Unit 3) | |
| quantitative (a measurement) | means: t procedures | |
| 2. How many groups, and how linked? | one sample, or paired data | one-sample t (paired: on the differences) |
| two independent groups | two-sample t | |
| 3. What is asked? | "estimate", "how much" | confidence interval |
| "is there convincing evidence", a claim | significance test |
For example, a teacher who measures each student's score before and after a review game has a quantitative response and paired data: a paired t test on the differences. A researcher comparing the proportion of adults who exercise at least 3 hours a week in two counties has a categorical response and two groups: a two-sample z test for proportions.
Common slips
- Adding standard errors instead of variances in the denominator.
- Switching the order of subtraction between the hypotheses, the statistic and the conclusion.
- Doubling (or not doubling) the tail area: one tail for or , two for .
- Concluding "the means are equal" after failing to reject.
- Claiming cause and effect from two random samples, or generalizing to a population from volunteers.