Module 6 — Comparing group means
Question: do men and women differ in mean systolic pressure? Do the three smoking groups differ? Scale outcome + categorical groups → t tests and ANOVA.
Open the sample (Ctrl+Shift+O). Everything here is under
Analyze → Compare Means.
Independent-samples t test — two groups
Independent-Samples T Test…, test variable SystolicBP, grouping variable Sex, Run.
The output shows each group's N, mean and SD, then the test: t, degrees of freedom, and the p value ("Sig."). Report the group means and their difference, not just p — "significant" without a size is half an answer.
One-Way ANOVA — three or more groups
One-Way ANOVA…, dependent SystolicBP, factor SmokingStatus; tick Post hoc (and, good practice, Homogeneity / Welch), Run.
The F test asks whether any group differs; with the planted smoking effect it should be significant. The post-hoc table then says which pairs differ — expect Current vs Never to carry it. Why not three t tests instead? Each extra test is another chance of a false positive; ANOVA plus corrected post-hocs is the disciplined route.
Exercise
- T test BMI by Sex. Difference? How large, in kg/m²?
- T test HeartRate by Hypertensive. The codebook says HeartRate is noise — practise writing the one-sentence honest summary of a null result.
- One-Way ANOVA of SystolicBP by StudyZone. No planted effect — does the F test agree?
- Explore first, test second: re-run module 3's Explore of SystolicBP by SmokingStatus and check the ANOVA told you nothing the confidence intervals had not already hinted at.
The syntax trail
independent_ttest variables=[SystolicBP], grouping=Sex
independent_ttest variables=[BMI], grouping=Sex
anova variables=[SystolicBP], factor=SmokingStatus, homogeneity=true, welch=true, posthoc=true