Define
Outcome coded 1 for elevated measured blood pressure and 0 otherwise. Predictors were defined before modelling; age was scaled in 10-year units.
DEMONSTRATION CASE USING SYNTHETIC DATA · SYNTHETIC CASE STUDY · R
A reproducible demonstration of how a public-health question becomes a logistic-regression workflow—with recoding, missingness, diagnostics and evidence limits visible.
WORKFLOW
The model is only the middle of the analysis. Coding, missingness and diagnostic decisions determine what its coefficients can mean.
Outcome coded 1 for elevated measured blood pressure and 0 otherwise. Predictors were defined before modelling; age was scaled in 10-year units.
Ranges, duplicates and cross-field logic were checked. Seven rows with missing outcome were excluded; predictor missingness was described, not silently imputed.
A pre-specified multivariable logistic model used age, sex, current smoking and low physical activity. No stepwise p-value hunting was used.
Linearity in the logit for age, influential observations, variance inflation, calibration and discrimination were reviewed before reporting.
INSPECTABLE R CODE
The downloadable script imports the synthetic CSV, preserves source fields, scales age, fits the declared binomial model and prints adjusted odds ratios with confidence intervals.
Download the complete .R scriptfit <- glm(
elevated_bp ~ age_10_years + sex +
current_smoker + low_physical_activity,
data = data,
family = binomial(link = "logit")
)
exp(cbind(OR = coef(fit), confint.default(fit)))ILLUSTRATIVE RESULTS
Values below are synthetic and demonstrate reporting structure. They are not findings about a real population.
| Predictor | Adjusted OR | 95% CI | p-value |
|---|---|---|---|
| Age, per 10 years | 1.28 | 1.11–1.48 | 0.001 |
| Current smoker | 1.74 | 1.10–2.77 | 0.019 |
| Low physical activity | 1.46 | 0.94–2.28 | 0.090 |
| Female | 0.92 | 0.61–1.39 | 0.690 |
Holding the listed variables constant, synthetic current smokers had estimated odds of elevated blood pressure 1.74 times those of non-smokers (95% CI 1.10–2.77). Because the design is cross-sectional, this association does not establish temporal order or causality. Residual confounding and measurement error remain possible.
MODEL REVIEW
No concerning collinearity signal among the included predictors.
Moderate discrimination; not a clinical validation claim.
Observed-versus-predicted risk was reviewed across probability groups.
Sensitivity review did not justify undocumented deletion.
YOUR STUDY WILL NEED ITS OWN MODEL
We will not copy this model onto a different design. Start with objectives, variables, sampling and the decision the analysis must support.