Repair the data foundation
The raw CSV has no header row. The revised import assigns all 21 expected columns, validates category codes and missingness, and retains all 224 source records rather than dropping the first observation.
Healthcare analytics · R · Logistic regression
A reproducible admission-time modeling study designed to answer a careful question: can routinely collected physiological measurements distinguish patients who survived from those who died—without letting future information leak into the model?
73.9%
Held-out accuracy
63.6%
Sensitivity for death
83.3%
Specificity
112
Patients analyzed
The challenge
The source dataset contains 224 observations from 112 critically ill patients in Southern California. Every patient appears twice: once at admission and once shortly before discharge or death. Those final measurements are informative, but they would not exist when an admission-time prediction is made.
The updated analysis treats that timing distinction as a core modeling decision. It validates the paired records, restricts the primary analysis to one admission record per patient, and then separates patients—not rows—into training and test sets. This removes both temporal leakage and within-patient duplication.
Approach
The raw CSV has no header row. The revised import assigns all 21 expected columns, validates category codes and missingness, and retains all 224 source records rather than dropping the first observation.
Each patient has an admission record and a final record collected near discharge or death. The analysis keeps only the 112 admission records so the model never learns from future information.
A logistic regression combines systolic blood pressure, mean central venous pressure, urinary output, hemoglobin, shock type, and an interaction between systolic pressure and urinary output.
With a fixed seed, 89 patients form the training set and 23 are held out for testing. Patient identifiers and the now-constant record field are excluded from the predictor set.
What the model found
On the held-out set, the model correctly classified 17 of 23 patients: 10 of 12 survivors and 7 of 11 patients who died.
Higher systolic blood pressure was associated with lower estimated odds of death, while higher mean central venous pressure was associated with higher estimated odds. Several shock categories also had elevated estimated odds relative to non-shock patients.
The report interprets these as adjusted associations, not causal effects, and treats the interaction between systolic pressure and urinary output explicitly.
Responsible interpretation
The 23-patient test set is small, the result comes from a single split, and shock-type confidence intervals are wide. The dataset also lacks complete documentation for its age, collection protocol, and several measurement units.
This retrospective portfolio analysis has no external validation and must not be used to guide patient care. Repeated grouped cross-validation, calibration analysis, ROC-AUC, uncertainty estimates, and a penalized logistic comparison are the clearest next steps.
Explore the complete work
Review the R pipeline, generated results, figures, and authoritative report in the public repository.