← All projects

Healthcare analytics · R · Logistic regression

Survival Classification in Critically Ill Patients

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

Make the evaluation match the real question.

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

From raw records to a reproducible patient-level test.

01

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.

02

Define the prediction moment

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.

03

Fit an interpretable model

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.

04

Evaluate unseen patients

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

Hemodynamic measures carried meaningful signal.

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

Promising evidence, not a clinical tool.

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.

Open GitHub repository ↗