πŸ“Š DecisionCurve - Decision Curve Analysis

Demo data: Pima Indians Diabetes (Smith et al., JASA 1988; UCI ML Repository)

1. Data Input

2. Variable Selection

Select continuous predictors to build logistic models.

3. Analysis Options


If case-control study, set known population prevalence. Leave as-is for cohort (auto-estimated from data).


Threshold Probe

Enter a threshold probability to mark on the plot with a vertical dashed line and intersection points.

Downloads






How to Read Decision Curve Analysis

What is DCA?

Decision Curve Analysis evaluates whether a prediction model is clinically useful by comparing its net benefit against two simple strategies: 'Treat All' and 'Treat None'. Unlike AUC which only measures discrimination, DCA directly answers: 'Will this model actually help patients?'

Reading the Main Plot
  • X-axis (Threshold Probability, Pt): The risk threshold at which you would decide to treat. Pt = 0.2 means you treat when predicted risk β‰₯ 20%.
  • Y-axis (Net Benefit): The net benefit of using the model at that threshold. Higher = better.
  • Model curves: Each colored line shows a single predictor or model.
  • Treat All (gray dotted): The net benefit if everyone received treatment.
  • Treat None (gray dashed): The net benefit if no one received treatment (always 0).
Key Interpretation Rules
  • A model is clinically useful when its curve is above both 'Treat All' AND 'Treat None' at clinically relevant thresholds.
  • If a curve falls below 'Treat None', the model is worse than doing nothing.
  • If a curve overlaps 'Treat All', the model offers no advantage over treating everyone.
  • The wider the gap between a model and the gray reference lines, the greater the clinical value.
Combined Model Detail Plot

When multiple predictors are selected, a multivariable logistic regression model is automatically fitted. The bottom plot zooms in on the Combined Model (red line) against Treat All / Treat None references, making it easier to identify the optimal threshold range.

Threshold Probe Tool

Use the 'Threshold Probability' input box + 'Set Probe' button to mark a specific Pt on the Combined Model plot. This draws an orange dashed line showing:

  • The exact Net Benefit at your chosen threshold (orange label on curve)
  • A horizontal line to the Y-axis showing NB value (left side)
  • The Pt value labeled below the X-axis
Summary Table Columns
  • NB@0.05, NB@0.10, ...: Net benefit at fixed threshold probabilities.
  • Max_Net_Benefit (blue bold): The highest net benefit achieved by each model across all thresholds.
  • Pt_at_Max: The threshold probability where maximum net benefit occurs.
Data Requirements
  • Outcome: Binary 0/1. 1 = event occurred (e.g., disease positive).
  • Predictors: Continuous numeric variables. Categorical variables are not supported.
  • ID columns: Automatically detected and excluded (name patterns: id, name, no, code, index).
  • Missing values: Rows with any NA are automatically removed.
  • Zero values: Biologically invalid zeros (e.g., glucose=0, bmi=0) are treated as missing and removed.
Net Benefit Formula

This app uses the epidemiological-parameter form (required for case-control reweighting):

NB = prev Γ— sens βˆ’ (1 βˆ’ prev) Γ— fpr Γ— (Pt / (1 βˆ’ Pt))

Where prev = population prevalence, sens = sensitivity (TP / cases), fpr = false positive rate (FP / controls).

An equivalent counting form is often seen in the original DCA literature:

NB = TP/n βˆ’ FP/n Γ— (Pt / (1 βˆ’ Pt))

Where n = total sample size, TP = true positives, FP = false positives.

Why They Are Equivalent

Let n_case = number of diseased subjects, n_ctrl = number of healthy subjects, n = n_case + n_ctrl. By definition:

β€’ prev = n_case / n     β€’ 1 βˆ’ prev = n_ctrl / n     β€’ sens = TP / n_case     β€’ fpr = FP / n_ctrl

Substitute these into the parameter form:

NB = (n_case/n) Γ— (TP/n_case) βˆ’ (n_ctrl/n) Γ— (FP/n_ctrl) Γ— (Pt/(1βˆ’Pt))

The n_case and n_ctrl terms cancel, leaving exactly the counting form:

NB = TP/n βˆ’ FP/n Γ— (Pt / (1 βˆ’ Pt)) βœ“

When to Use Which Form
  • Counting form (TP/n βˆ’ FP/n...): Appropriate for cohort studies where sample prevalence equals population prevalence.
  • Parameter form (prev Γ— sens...): Required for case-control studies where the sample has been artificially enriched with cases. You provide the true population prevalence externally, and the formula reweights sensitivity and FPR to reflect the real world.
  • This app always uses the parameter form. If your data is a random cohort sample, prev is estimated from the data itself, and both forms give the same result.
Export & Download
  • PNG: High-resolution plot (300 DPI) for publications.
  • CSV (Summary): BOM header for direct opening in Windows Excel.
  • CSV (Raw DCA): Complete point-by-point DCA data for custom plotting.
  • CSV (Optimal Threshold): Threshold ranges where each model beats Treat All / Treat None.
  • CSV (Full Data): The cleaned dataset used for analysis, with predictions appended.
  • CSV (Prediction): Just the ID, outcome, and Combined Model predicted probabilities.
Demo Data Source

The demo dataset is the Pima Indians Diabetes dataset from the UCI Machine Learning Repository (via mlbench R package), with minor measurement-level jitter added for realism. Biologically invalid zero values (missing indicators in the original data) have been removed.

九方思乐 · math81.com · η²€ICP倇2026092768号