College practice · Worked answers
Two-sample t test practice
A two-sample t test compares population means from two independent groups when the population standard deviations are unknown. Start by checking how the data were collected. Two columns do not automatically mean two independent samples: before-and-after measurements on the same people are paired.
Choose the independent-samples model
Welch’s two-sample t test allows different population variances. It uses both sample standard deviations without assuming they estimate one common variance. A pooled t test adds an equal-variance assumption; do not pool just because the sample sizes happen to match.
Check independence within and between samples, how the observations were sampled or assigned, and whether the mean’s sampling distribution is reasonable. With small samples, strong skew or outliers deserve particular attention. A large sample does not fix dependence or selection bias.
Build the statistic from three pieces
SE = √(s₁²/n₁ + s₂²/n₂)
t = [(x̄₁ − x̄₂) − Δ₀] / SE
Δ₀ is the hypothesized population difference, often zero. Keep the subtraction order consistent in the hypothesis, estimate, and conclusion. For Welch’s method, let a = s₁²/n₁ and b = s₂²/n₂. Then df = (a + b)² / [a²/(n₁ − 1) + b²/(n₂ − 1)]. Software normally keeps noninteger degrees of freedom.
Avoid the two-column trap
| Data | Usual starting point |
|---|---|
| Different randomly sampled people in each group | Independent two-sample method |
| The same people measured twice | Paired method on within-person differences |
| Counts of success and failure | Proportion methods, not a test of numerical means |
Work through two examples
Work a Welch test with simple numbers
- Independent samples have n₁ = n₂ = 10, x̄₁ = 18, x̄₂ = 15, and s₁ = s₂ = 3. Assume the model conditions hold. Test a zero difference against a two-sided alternative at α = 0.05.
- SE = √(9/10 + 9/10) = √1.8 ≈ 1.3416. Then t = 3/1.3416 ≈ 2.2361.
- Welch df = 1.8² / [(0.9²/9) + (0.9²/9)] = 18. The two-sided p-value is about 0.03825, so reject the zero-difference null at 0.05.
Notice when the setup is paired
- Twelve students take a test before and after a study workshop. Each row belongs to one student.
- The observations across columns are linked, so an independent two-sample analysis would ignore that design.
- Compute each student’s after-minus-before difference, then use a paired t method if its conditions hold. There are 12 differences, not 24 independent students.
Try it yourself
Choose an answer, then check your reasoning. You can retry any question or open its solution.
Show solution 1
√2, about 1.414. SE = √(16/16 + 36/36) = √2. Add the variance contributions before taking the square root.
Why the other choices are wrong:
- 2: You stopped before the square root: 16/16 + 36/36 = 2. Take √2 at the end. (Adding 4/√16 + 6/√36 also gives 2, but standard errors don’t add; variances do.)
- 10: That adds the standard deviations, 4 + 6. Square each one, divide by its own n, add, then take the square root.
- About 0.417: That divides s by n without squaring: 4/16 + 6/36. Use s²/n.
Show solution 2
3. t = (6 − 0)/2 = 3. The estimate is three standard errors above the null difference.
Why the other choices are wrong:
- 12: That multiplies by the SE. Divide by it instead.
- 0.333: That is SE divided by the estimate. Flip it: estimate ÷ SE.
- 4: 6 − 2 subtracts the SE. Divide the difference by the SE.
Show solution 3
Each participant measured before and after. Measurements on the same participant are linked. A paired analysis studies the within-person differences.
Why the other choices are wrong:
- Two separate random groups: Separate random groups are independent. Nothing links an observation in one group to one in the other.
- Two groups with equal sample sizes: Equal sizes can happen by design or by chance. Pairing needs a real link, like the same person measured twice.
- Treatment and control groups made of different patients: Different patients in each group aren’t linked, so these are independent samples.
Show solution 4
Equal population variances. Pooling uses a common population variance assumption. Welch’s approach does not require that equality.
Why the other choices are wrong:
- Equal sample sizes: Pooling doesn’t require equal n. It assumes the population variances are equal.
- Known population standard deviations: If the σ values were known, you would use z. Both t tests estimate spread from the samples.
- Equal sample means: Equal population means is usually what H₀ says. It isn’t an assumption of the pooled method.
Show solution 5
Insufficient evidence of a population mean difference. The p-value is above α. Failing to reject the zero-difference null is not proof of equality or absence of an effect.
Why the other choices are wrong:
- The means are proven equal: Not rejecting doesn’t prove the means are equal.
- There is no possible effect: There could be a real effect that this study was too small to detect.
- Reject H₀, because 0.08 is small: 0.08 is larger than 0.05, so you don’t reject at this α.
Show solution 6
About 2.53. SE = √(16/8 + 4/8) = √2.5 ≈ 1.581. Then t = (24 − 20)/1.581 ≈ 2.53.
Why the other choices are wrong:
- 4: 4 is just the difference in means. Divide it by the SE.
- About 1.60: That divides by 2.5, the sum of variance terms, before taking the square root. SE = √2.5 ≈ 1.58.
- About 0.67: That divides by s₁ + s₂ = 6. The SE is √(s₁²/n₁ + s₂²/n₂).
Show solution 7
12 differences, df = 11. Each student gives one after-minus-before difference, so n = 12. A paired t test is a one-sample t test on those differences, with df = 12 − 1 = 11.
Why the other choices are wrong:
- 24 observations, df = 22: That treats 24 independent students. The pairs make 12 differences.
- 12 differences, df = 12: The count is right, but a one-sample t test on the differences uses n − 1 = 11.
- 24 observations, df = 23: There are only 12 independent units; each student contributes one difference.
Show solution 8
t = 2. Keep the same subtraction order as the hypotheses: t = (x̄₁ − x̄₂ − 0)/SE = 3/1.5 = 2. A positive t points in the direction of Hₐ.
Why the other choices are wrong:
- t = −2: That uses x̄₂ − x̄₁. Match the order in the hypotheses: x̄₁ − x̄₂ = +3.
- t = 0.5: That is SE divided by the difference. Flip it.
- t = 4.5: That adds the SE. Divide by it instead.
Answer key
Open all answers
- √2, about 1.414. SE = √(16/16 + 36/36) = √2. Add the variance contributions before taking the square root.
- 3. t = (6 − 0)/2 = 3. The estimate is three standard errors above the null difference.
- Each participant measured before and after. Measurements on the same participant are linked. A paired analysis studies the within-person differences.
- Equal population variances. Pooling uses a common population variance assumption. Welch’s approach does not require that equality.
- Insufficient evidence of a population mean difference. The p-value is above α. Failing to reject the zero-difference null is not proof of equality or absence of an effect.
- About 2.53. SE = √(16/8 + 4/8) = √2.5 ≈ 1.581. Then t = (24 − 20)/1.581 ≈ 2.53.
- 12 differences, df = 11. Each student gives one after-minus-before difference, so n = 12. A paired t test is a one-sample t test on those differences, with df = 12 − 1 = 11.
- t = 2. Keep the same subtraction order as the hypotheses: t = (x̄₁ − x̄₂ − 0)/SE = 3/1.5 = 2. A positive t points in the direction of Hₐ.
Common questions
Do equal sample sizes mean the data are paired?
No. Pairing requires a meaningful link between observations, such as repeated measurements on the same person.
Should I always pool the variances?
No. Use the method specified by the problem and justified by the assumptions. Welch’s method allows unequal population variances.
Why can Welch degrees of freedom be a decimal?
They come from an approximation based on the estimated variance contributions. Software can use the noninteger value directly.
Keep practicing
Try 3 days free3-day free trial, no card needed.
Sources and fact checks
Definitions and methods checked against these textbook references. Practice scenarios and worked numbers were written for this guide.