Explanation

Two populations: choosing the right comparison

Many real questions compare two groups: a new drug versus a placebo, two teaching methods, men versus women. The first decision is how the samples were obtained.

  • Independent samples: the two samples are drawn separately; knowing a value in one tells nothing about the other.
  • Matched (paired, dependent) samples: the two measurements come from the same objects or from naturally linked pairs (before/after on the same people, twins, left/right hand). Both samples have the same size and each point is matched with exactly one point in the other.

The same hypothesis-test and confidence-interval ideas as in Weeks 8 and 9 apply; what changes is the random variable, which is now the difference between the two sample statistics, and its standard error.

Difference of two means, σ's known (normal test)

The random variable is x̄₁ − x̄₂, which is approximately normal with mean μ₁ − μ₂ and standard error √(σ₁²/n₁ + σ₂²/n₂). Test statistic: z = [(x̄₁ − x̄₂) − (μ₁ − μ₂)]/SE, where the hypothesized difference is usually 0. A confidence interval is (x̄₁ − x̄₂) ± z*·SE.

Difference of two means, σ's unknown (t test)

Use the sample standard deviations: SE = √(s₁²/n₁ + s₂²/n₂). The statistic follows Student's t with degrees of freedom obtained from the Welch (Satterthwaite) approximation when variances are not pooled; software or a calculator gives it, and the smaller of n₁ − 1 and n₂ − 1 is a conservative hand estimate. Conditions: independent random samples and approximately normal populations (or large samples). Pooling the variances is only reasonable if the population variances are equal (check with the F test of Week 12).

Matched samples

Subtract one measurement from the other for every pair to get the differences d, and then perform a one-sample t test on the differences: t = d̄/(s_d/√n), df = n − 1. The hypotheses concern the mean difference μ_d (usually H₀: μ_d = 0). If fewer than 30 pairs, the differences should be approximately normal. Pairing removes variation between individuals, which usually makes the test more powerful than treating the groups as independent. Using an independent-samples method on paired data ignores the link and is a mistake.

Difference of two proportions

The random variable is p̂₁ − p̂₂, approximately normal when each sample has enough successes and failures.

  • Hypothesis test with H₀: p₁ = p₂: use the pooled proportion p̂ = (x₁ + x₂)/(n₁ + n₂) in the standard error √(p̂(1 − p̂)(1/n₁ + 1/n₂)), because under H₀ the two proportions are the same.
  • Confidence interval for p₁ − p₂: use the unpooled standard error √(p̂₁q̂₁/n₁ + p̂₂q̂₂/n₂), since no equality is assumed.

Interpreting results

A confidence interval for a difference that does not contain 0 matches a significant two-tailed test at the corresponding level. State conclusions about which group is larger and by how much, and remember that significance does not prove cause unless the groups were formed by a randomized experiment.

Common mistakes

Failing to recognise paired data; pooling variances automatically; using pooled p̂ in a confidence interval; subtracting in a different order for the estimate and the hypotheses (keep the order consistent); using n₁ + n₂ − 2 degrees of freedom when variances are not pooled.

Practice tasks

  1. Decide whether each is paired or independent: (a) weights of 20 people before and after a diet; (b) test scores of two different classes; (c) left and right hand grip of each athlete.
  2. x̄₁ = 52, σ₁ = 6, n₁ = 36; x̄₂ = 48, σ₂ = 8, n₂ = 64. Test H₀: μ₁ = μ₂ (two-tailed).
  3. x̄₁ = 20, s₁ = 4, n₁ = 16; x̄₂ = 17, s₂ = 5, n₂ = 25. Compute the t statistic.
  4. Paired differences (after − before): 3, 5, 1, 4, 2. Test H₀: μ_d = 0 two-tailed at 0.05 (critical t for df = 4 is 2.776).
  5. 45 of 100 in group 1 and 30 of 100 in group 2 are successes. Test H₀: p₁ = p₂ (two-tailed).
  6. Build a 95% CI for p₁ − p₂ with the data from task 5.
  7. Explain why using an independent-samples test on paired data is usually a mistake.