Diabetes Risk Portal — Publication-Grade Project Report
Multivariable Logistic Regression & Decision Support System on 96,146 clean clinical evaluation records (deduplicated from the 100,000 raw dataset)
1. Primary Research Question & Analytical Objectives
"Can we accurately predict whether a patient has diabetes using age, BMI, blood sugar levels, and health history—while predicting as many diabetic cases as possible?"
In clinical predictive modeling, early diagnosis of diabetes mellitus is essential to mitigate long-term microvascular and macrovascular complications. This project develops a publication-grade, reproducible machine learning classification pipeline in R to deliver transparent, actionable risk predictions for healthcare providers.
Biomarker vs. Lifestyle Dominance
Do laboratory diagnostic biomarkers (HbA1c level and blood glucose level) exert a significantly stronger predictive influence on diabetes risk than demographic and lifestyle factors (BMI, age, and smoking history)?
2. Four-Step Analytic Methodology
To guarantee mathematical rigor and complete methodological reproducibility, the analytical pipeline follows a structured four-step workflow:
Data Cleaning & Stratification
Categorical variables and binary flags reformatted as factors. Deduplicated raw cohort to 96,146 clean records across 4 clinical risk tiers.
80/20 Stratified Split
Partitioned into 80% train / 20% test using stratified sampling. Normalization parameters derived strictly from training data to prevent data leakage.
10-Fold CV Training
Evaluated via 10-fold cross-validation with tidymodels logistic regression. Achieved 95.9% mean CV Accuracy and 96.2% ROC-AUC.
Sensitivity-Driven Evaluation
Evaluated on held-out test set, prioritizing Area Under ROC (ROC-AUC) and Sensitivity (Recall) for clinical diagnostic safety.
1. Recipe Blueprint: recipe(diabetes ~ ., data = train_data)
2. Parameter Calculation: Derived strictly on train_data via step_normalize()
3. Test Evaluation: bake(prep_recipe, new_data = test_data) using frozen training parameters
3. Key Analytical Findings & Multivariable Odds Ratios
Multivariable logistic regression demonstrated that laboratory diagnostic biomarkers—specifically HbA1c and Blood Glucose levels—are the dominant clinical predictors of diabetes status, as summarized in the publication-grade model findings table below:
| Domain & Clinical Predictor Variable | Odds Ratio (OR) | 95% Confidence Interval | p-value | Clinical Significance & Effect Size |
|---|---|---|---|---|
| Laboratory Diagnostic Biomarkers | ||||
| HbA1c Level (%) | 10.34x | [9.64 – 11.09] | p < 0.001 *** | Primary Clinical Predictor: Each +1.0% increase in HbA1c multiplies diabetes odds by ~10.34x. |
| Blood Glucose Level (mg/dL) | 1.034x | [1.033 – 1.035] | p < 0.001 *** | Continuous Glucose Driver: Each +25 mg/dL shift in glucose increases diabetes odds by ~2.37x. |
| Cardiovascular Comorbidities | ||||
| Hypertension (Yes vs No) | 2.15x | [1.96 – 2.35] | p < 0.001 *** | Independent Vascular Risk: Co-existing hypertension more than doubles diabetes odds (2.15x). |
| Heart Disease (Yes vs No) | 2.14x | [1.90 – 2.41] | p < 0.001 *** | Independent Cardiac Risk: History of heart disease independently doubles diabetes odds (2.14x). |
| Demographics & Anthropometrics | ||||
| Body Mass Index (BMI) | 1.092x | [1.087 – 1.098] | p < 0.001 *** | Adiposity Risk Factor: Each unit increase in BMI (kg/m²) increases diabetes odds by ~9.2%. |
| Age (Years) | 1.048x | [1.046 – 1.050] | p < 0.001 *** | Demographic Baseline: Each additional year of age increases diabetes odds by ~4.8%. |
ln( p / (1 - p) ) = β0 + β1(HbA1c) + β2(Glucose) + β3(Hypertension) + β4(HeartDisease) + β5(BMI) + β6(Age)
Odds Ratio (OR) = exp(β_i) | 95% CI = exp( β_i ± 1.96 × SE(β_i) )
4. Clinical Sensitivity & Diagnostic Impact
In population-level screening programs, prioritizing clinical sensitivity (recall) minimizes False Negatives—preventing undetected diabetic patients from developing unmonitored cardiovascular and metabolic complications. The cross-validated model provides a stable, highly scalable decision-support framework to empower early clinical intervention.
96,146
Total Patients Cataloged
8.82%
Prevalence of Diabetes
85.21%
Cohort At Risk (Mod / High)
Categorizes 96,146 cataloged patients across 4 risk tiers using clinical indicators. High Risk patients have HbA1c ≥ 5.7% or Blood Glucose ≥ 140 mg/dL, while Moderate Risk denotes BMI ≥ 25 kg/m².
Compares glycated hemoglobin (HbA1c) levels across risk classifications. Median HbA1c escalates sharply in the diabetic cohort (≥ 6.5%), confirming HbA1c as the primary metabolic risk predictor.
Analysis of the 96,146 patient cohort indicates that while overall diabetes prevalence is 8.82%, a staggering 85.21% of non-diabetic individuals exhibit moderate to high metabolic risk, highlighting critical opportunities for early preventive intervention.
HbA1c concentration serves as the core diagnostic metric. Non-diabetic cohorts center within normal ranges (< 5.7% or 5.7–6.4%), whereas diabetic individuals display marked escalation (mean HbA1c > 6.9%), supporting multivariable risk modeling.
Diabetes prevalence demonstrates a strong non-linear age escalation. While prevalence remains below 3% in cohorts under age 30, it surges to over 15% in individuals aged 60 and older, confirming age as a dominant baseline demographic risk vector.
Patients with a history of former or current smoking exhibit a higher proportion of Moderate and High Risk metabolic tiers compared to non-smokers, reflecting cumulative vascular and metabolic stress.
HbA1c and Blood Glucose levels exhibit a strong positive co-elevation. Diabetic individuals cluster almost exclusively in the upper-right quadrant (HbA1c ≥ 6.5%, Glucose ≥ 140 mg/dL), confirming dual-biomarker thresholds as primary diagnostic boundaries.
Co-existing cardiovascular conditions markedly amplify diabetes risk. Patients with both Hypertension and Heart Disease present more than double the diabetes prevalence of non-hypertensive patients, highlighting vascular damage as an independent risk driver.
Counterfactual modeling demonstrates significant healthcare leverage. Combining targeted BMI and glycemic control shifts prevents thousands of diabetes diagnoses across 96,146 clean clinical evaluation records (deduplicated from the 100,000 raw dataset), mitigating long-term microvascular healthcare expenditure.
Project Conclusion: Biomarkers Drive Primary Predictive Power
Empirical Findings & Diagnostic Synthesis Across 96,146 Patient Evaluation Cohort
1. Primary Research Question & Claim Verdict
"YES — We can accurately predict diabetes status (95.9% CV Accuracy, 96.2% ROC-AUC). Glycated hemoglobin (HbA1c) and blood glucose levels exert a significantly stronger predictive influence than demographic or lifestyle factors."
Multivariable logistic regression on 96,146 deduplicated clinical records confirms that laboratory diagnostic biomarkers are the single most dominant risk predictors. Each +1.0% elevation in HbA1c multiplies diabetes odds by 10.34x (95% CI: [9.64 – 11.09], p < 0.001), while fasting/random blood glucose increases odds continuously by 1.034x per mg/dL. In contrast, demographic variables such as BMI (OR: 1.092) and Age (OR: 1.048) represent secondary continuous risk multipliers.
Laboratory Metrics Outweigh Demographics
HbA1c and Blood Glucose drive over 80% of model log-odds variance. Metabolic diagnostic thresholds (HbA1c ≥ 6.5%, Glucose ≥ 140 mg/dL) serve as clear physiological boundary conditions for classification.
Prioritizing Diagnostic Recall
In clinical population screening, missing a true diabetic patient carries severe microvascular risk. The model achieves 96.2% ROC-AUC, enabling threshold tuning to minimize False Negatives.
Targeting High-Risk Non-Diabetics
While diabetes prevalence is 8.82%, 85.21% of non-diabetic patients exhibit moderate to high risk. Targeted interventions (such as a 5–10% population BMI reduction) offer vital preventive leverage.
2. Final Model Benchmarks & Specifications
| Evaluation Domain | Metric / Result | Methodological Specification |
|---|---|---|
| Total Cohort Size | 96,146 Patients | Deduplicated clinical records evaluated across 80/20 train/test split. |
| Overall Diabetes Prevalence | 8.82% | Stratified sampling preserving class balance across partitions. |
| 10-Fold CV Accuracy | 95.9% | Resampled evaluation across 10 cross-validation training folds. |
| 10-Fold CV ROC-AUC | 96.2% | Exceptional discrimination capacity across probability decision cutoffs. |
| Primary Clinical Predictor | HbA1c (OR: 10.34x) | 95% CI: [9.64 – 11.09], p < 0.001 *** |