Stroke Risk Prediction Using Logistic Regression and Classification Trees in R
Abstract
Stroke remains one of the leading causes of death and long-term disability worldwide, and early identification of high-risk individuals can meaningfully improve prevention outcomes. This study applies logistic regression and classification tree methods in R to estimate stroke risk using the Kaggle Stroke Prediction Dataset (fedesoriano, 2021), which contains 5,110 patient records collected from real clinical data. Ten candidate predictors drawn from demographic and clinical variables were considered, with missing BMI values imputed using the column median. Model selection was carried out using established statistical criteria, computed in R version 4.3.1. Five predictors emerged as significant: age, hypertension, heart disease, average glucose level, and body mass index. The final logistic regression model, which included interaction terms between age and hypertension and between glucose level and BMI, achieved 84.04% prediction accuracy on a held-out test set and a cross-validation error of 16.01%. A pruned classification tree with six terminal nodes reached 80.13% accuracy using the same core predictors. These findings suggest that logistic regression has potential as an interpretable, statistically grounded approach for stroke risk prediction — one that could inform low-cost screening tools in resource-limited settings, pending clinical validation.
// Source
Authors: Safa Tasfia
Institutions: East–West University