Module 7: Relationships between scale variables
Question: does blood pressure rise with BMI, and by how much, holding age constant?
Open the sample (Ctrl+Shift+O).
Correlation
Analyze → Correlate → Bivariate…, variables Age, BMI, SystolicBP, HeartRate, Run.
The matrix gives each pair's Pearson r and its p. Expect Age–SystolicBP and BMI–SystolicBP clearly positive, and everything involving HeartRate near zero (the planted null). Remember module 4's scatterplots: r is only trustworthy when the cloud is roughly linear, so always look first.
Linear regression
Analyze → Regression → Linear…, dependent SystolicBP, predictors Age and BMI, Run.
How to read the three blocks:
- Model summary: R²: the share of SystolicBP's variance the two predictors explain together.
- ANOVA: whether the model beats no model at all.
- Coefficients: the substance. The BMI coefficient is mmHg per BMI unit, holding Age constant; the "holding constant" is what regression adds over correlation. The constant is the fitted value at Age 0, BMI 0, which is outside the data and not meaningful on its own.
Write the fitted equation out once by hand:
SystolicBP ≈ b₀ + b₁·Age + b₂·BMI. Predict the SBP of a 50-year-old with
BMI 30 and sanity-check it against the Explore output from module 3.
Checking the model, not just reading it
A regression will print coefficients for any data you hand it, including data that violate its assumptions. Re-run the model with Diagnostics ticked and you get three plots that check them:
- Residuals vs Fitted: should be a shapeless cloud. A curve means the relationship is not linear; a funnel means the spread depends on the prediction.
- Scale-Location: the same homoscedasticity check made easier to read, plotting √|standardized residual| against the fitted value. A rising trend is the funnel again.
- Normal Q-Q of the standardized residuals: points on the reference line mean the residuals are plausibly normal, which is what the p values assume.
A separate Casewise diagnostics option adds the per-case table (leverage and Cook's distance), which answers a different question: is a handful of cases steering the whole fit?
Reading these before quoting R² is the difference between a model you have run and a model you can defend.
Exercise
- Add TotalCholesterol_mmolL as a third predictor. Does R² move much? Is its coefficient significant?
- Correlate PhysicalActivity_minWk with TotalCholesterol_mmolL, the codebook's documented null pair. Report it honestly.
- Spearman instead of Pearson (the method option): rank-based, robust to outliers and curvature. Do the Age/BMI/SBP conclusions change?
- Re-run the regression with Diagnostics on. Is Residuals vs Fitted a shapeless cloud, or does it fan out? Then add Casewise diagnostics: does any single case stand out on Cook's distance?
The syntax trail
correlate variables=[Age, BMI, SystolicBP, HeartRate]
linear_regression dependent=SystolicBP, predictors=[Age, BMI]
linear_regression dependent=SystolicBP, predictors=[Age, BMI], diagnostics=true, casewise=true
correlate variables=[PhysicalActivity_minWk, TotalCholesterol_mmolL]