Week 5 (biostats) - CI & Hypothesis Testing
Confidence Intervals (CI)
- An interval around a sample statistic that likely captures the population parameter.
- Common level: 95% (also 90%, 99%).
- General form: CI=sample statistic±multiplier×SE
- Upper / Lower limits shown as the interval around the statistic.
Hypothesis Testing Overview
- Hypothesis: a statement about the population; use sample data to infer about the population.
- Purpose: determine if observed sample results could be due to chance.
- Two main hypotheses:
- Null: H<em>0:μ</em>1−μ2=0 (no difference).
- Alternative: H<em>a:μ</em>1−μ2=0 (two-sided) or one-sided variants.
- Errors (when making a decision about H0):
- Type I error: reject H0 when it is true.
- Type II error: fail to reject H0 when it is false.
- P-values describe evidence against H0; not a direct measure of importance.
- Typical threshold: p < 0.05 indicates significance; if p≥0.05, insufficient evidence to reject H0. Do not say "accept" the null.
Steps of Hypothesis Testing
- State the study, objectives, and design.
- State hypotheses (null and alternative); decide on one- or two-sided; justify.
- State assumptions and check them.
- Analyze the data: compute test statistic, obtain the p-value, and calculate a 95% CI.
- Discuss results and infer about the population.
Two-Sample (Independent) t-Test: Equal vs. Unequal Variances
- Data: two independent groups, continuous outcome.
- Difference in means: Δ=xˉ<em>1−xˉ</em>2
Equal variances (pooled SD)
- Degrees of freedom: df=n<em>1+n</em>2−2
- Pooled SD squared: S<em>p2=n</em>1+n2−2(n</em>1−1)SD<em>12+(n</em>2−1)SD<em>22
- Standard Error: SE=S<em>p2(n</em>11+n21)
- t-statistic: t=SExˉ<em>1−xˉ</em>2
- 95% CI: (xˉ<em>1−xˉ</em>2)±t∗⋅SE where t∗ is the 2-sided critical value for the given df.
Unequal variances (Welch)
- Standard Error: SE=n</em>1SD<em>12+n</em>2SD<em>22
- Degrees of freedom: Welch–Satterthwaite approximation (df not equal to n1+n2-2; use appropriate table/software).
- 95% CI use the corresponding t* with the Welch df.
- Decision via p-value from the t-statistic with Welch df.
Checking Variances (Equal vs. Unequal SD)
- Practical check: compare SDs/variances.
- Rule of thumb: ratio of variances = SD</em>22SD<em>12
- If ratio < 2, assume equal variances.
- If ratio ≥ 2, assume unequal variances.
- Statistical check (Method 3): Use software (e.g., GraphPad Prism) to test H0: equal SDs vs Ha: unequal SDs.
- If p-value > 0.05, fail to reject H0 (assume equal variances).
- If p-value < 0.05, reject H0 (assume unequal variances).
Interpreting P-Values and Levels of Evidence
- p-value interpretation: probability, under H0, of observing data as extreme or more extreme than what was observed.
- Levels of evidence (illustrative):
- p = 0.05: weak evidence against H0
- p = 0.01: increasing evidence
- p = 0.001: strong evidence
- p = 0.0001: very strong evidence
- Example guidance: See common p-value interpretations (e.g., p-value = 0.36 = insufficient evidence; p-value = 0.00014 = strong evidence).
Example: Birth Weights (Independent Two-Sample t-Test)
- Data: Heavy smokers (n1=14), Non-smokers (n2=15); means 3.1743 kg and 3.6267 kg; SDs 0.4631 and 0.3584.
- Step 3 calculations:
- Difference: Δ=xˉ<em>1−xˉ</em>2=−0.4524 kg
- SE (pooled equal variances): SE=0.15317
- df: 27
- t* (95% CI): t∗=2.05
- 95% CI: Δ±t∗⋅SE=−0.4524±2.05×0.15317⇒[−0.77,−0.14] kg
- Two-sided p-value: between 0.005 and 0.01
- Interpretation: CI does not include 0 and p < 0.05 → significant difference. Heavy smokers have lower birth weight.
Practical Output and Reporting
- Report: means (with SE or SD), df, t-statistic, p-value, and 95% CI for the mean difference.
- Key takeaway: 95% CI for the difference and the p-value together indicate significance and direction of effect.
- Distinguish between t-multiplier and t-statistic:
- t-multiplier: the critical value used to form the 95% CI (depends on df).
- t-statistic: computed from data to test the hypothesis.
- CI for difference (two independent means, equal variances):
Δ±t∗⋅SE,SE=(n<em>1+n</em>2−2(n<em>1−1)SD</em>12+(n<em>2−1)SD</em>22)(n<em>11+n</em>21) - df (equal variances): df=n<em>1+n</em>2−2
- t-statistic (equal variances): t=SExˉ<em>1−xˉ</em>2
- Pooled SD: S<em>p=n</em>1+n2−2(n</em>1−1)SD<em>12+(n</em>2−1)SD<em>22
- Unequal variances: SE = n</em>1SD<em>12+n</em>2SD<em>22
- p-value interpretation: compare with 0.05 cutoff; report as two-sided unless a one-sided test was planned.
Next Steps and Reminders
- Always compute and report both the 95% CI and the p-value.
- Use the appropriate SE formula depending on equal or unequal variances.
- Check assumptions (normality, independence) before choosing the test.
- Use the CI to convey the precision and direction of the effect, not just the p-value.