← All projects

Healthcare analytics · R · Logistic regression

Predicting Prostatic Capsular Penetration

A modern extension of a 2018 analysis, built to answer a focused question: how accurately can baseline clinical measurements predict capsule penetration among patients already diagnosed with prostate cancer?

380

Observations

0.810

Primary model ROC AUC

0.173

Primary model Brier score

200

Cross-validation folds

The challenge

Extend historical work without rewriting its story.

The project uses the Prostate Cancer Study dataset described by Hosmer and Lemeshow: 380 historical, confidentiality-modified records from a single clinical setting. The outcome is whether a tumor penetrated the prostatic capsule—not whether a patient has prostate cancer.

The first task was to faithfully reproduce the 2018 course analysis. The second was to add a prespecified modern evaluation centered on out-of-sample prediction, calibration, and model stability while keeping the candidate models small and interpretable.

Approach

From historical reproduction to internal validation.

01

Verify and reproduce

The workflow reacquires the public Prostate Cancer Study data, validates its structure and values, and reproduces the principal coefficients, confidence intervals, odds ratios, and AIC from the original 2018 SDSU analysis.

02

Prespecify the extension

Before model fitting, the analysis fixed the population, predictor representations, candidate models, validation design, performance measures, and interpretation rules—avoiding an unrestricted search for a favorable result.

03

Compare interpretable models

Three logistic regression specifications were evaluated: the historical benchmark, a primary modern model with age and log-transformed PSA, and a limited nonlinear PSA model using a natural spline.

04

Validate out of sample

Outcome-stratified 10-fold cross-validation was repeated 20 times with identical saved folds for every model. Performance was assessed through discrimination, prediction error, calibration, and stability.

What the analysis found

Simpler models held their ground.

Digital rectal examination findings, PSA, and Gleason score carried meaningful predictive information. The primary modern model reached a mean cross-validated ROC AUC of 0.810, almost identical to the historical benchmark at 0.809.

Adding age and modeling PSA on a doubling scale changed the interpretation but did not materially improve prediction. The nonlinear PSA model performed slightly worse and showed more overfitting.

Adding baseline detection of capsular involvement did not provide stable incremental value. Excluding two unusual zero Gleason scores left the conclusions essentially unchanged, and the tumor-volume analysis remained exploratory and inconclusive.

Responsible interpretation

A methodological demonstration, not a clinical tool.

Calibration intercepts were near zero, but slopes below one indicated modest overfitting. The analysis is internally validated only; it has not been tested in an external population.

The dataset is small, historical, limited to one setting, and modified for confidentiality. It cannot establish contemporary clinical utility, support treatment decisions, or provide an adequate fairness assessment.

The result is best read as evidence for parsimony and reproducible model evaluation—not as a deployable prediction system or medical device.

Explore the complete work

Review the R pipeline, analysis plans, machine-readable results, figures, and complete Quarto report in the public repository.

Open GitHub repository ↗