Week 6 (biostats) - T-test
Paired t-test: Key ideas
- Use when you have paired/matched observations (e.g., before-after on the same subjects).
- Compare mean of differences, not the two raw groups.
- Let D_i = observation in group 1 − observation in group 2 for each pair.
- Null hypothesis: H0:\ \mud = 0
- Alternative: Ha:\ \mud \neq 0 (two-sided) or one-sided as planned.
- Assumptions: differences are independent and approximately normally distributed.
- Difference data:
- Mean difference: \bar{d} = \frac{1}{n}\sum{i=1}^n di
- Standard deviation of differences: SDd = \sqrt{\frac{1}{n-1}\sum{i=1}^n (d_i - \bar{d})^2}
- Standard error of the mean difference: SE = \frac{SD_d}{\sqrt{n}}
- t-statistic: t = \frac{\bar{d}}{SE}
- Degrees of freedom: df = n - 1
- 95% CI for the mean difference: \bar{d} \pm t_{df,0.025} \cdot SE
- Decision rule: if p-value < 0.05 (two-sided), reject H0; otherwise fail to reject.
Example 2: Sleep study (Paired t-test)
- Design: 10 patients; each measured on drug and on placebo (paired).
- Differences: di = \text{Drug}i - \text{Placebo}_i
- Summary results (example):
- Number of pairs: n = 10
- Mean difference: \bar{d} = 1.08 hours
- SD of differences: SD_d = 2.31 hours
- Standard error: SE = \frac{SD_d}{\sqrt{n}} = \frac{2.31}{\sqrt{10}} \approx 0.73
- t-statistic: t = \frac{\bar{d}}{SE} = \frac{1.08}{0.73} \approx 1.48
- Degrees of freedom: df = n - 1 = 9
- Two-sided p-value: p \in (0.10, 0.20)
- 95% CI for the mean difference: \bar{d} \pm t_{9,0.025} \cdot SE = 1.08 \pm 2.26 \cdot 0.73 \approx [-0.57, \ 2.73]
- GraphPad result example: p = 0.1731\,,\; \text{Mean difference} = \bar{d} = 1.08\,,\; \text{95% CI} = [-0.57, 2.73]\,
Interpretation
- If 95% CI for the mean difference includes 0, the difference is not statistically significant at the 0.05 level.
- In this example: CI includes 0, and p > 0.05 → do not reject H0; the drug does not have a significant effect on sleep duration.
Steps to report (brief workflow)
- State objective and study design (paired observations).
- State hypotheses: H0: \mud = 0\quad vs\quad Ha: \mud \neq 0.
- Check assumptions (normality of differences, independence).
- Compute: \bar{d},\ SD_d,\ SE,\ t,\ df,\ p\text{-value},\ 95\%\ CI.
- Interpret: p-value and CI; conclude whether there is a significant difference.
- Report results succinctly with means, difference of means, CI, and p-value.
Quick reference: decision when to use which t-test
- Two groups, continuous data, independent observations: independent-samples t-test.
- Two measurements on the same subjects (paired): paired t-test.
- Check equal variances if using two-sample t-test; otherwise use unequal-variances version.