Decision Curve Analysis
Source:vignettes/18-decision-curve-analysis.Rmd
18-decision-curve-analysis.RmdDecision Curve Analysis
(decisioncurve(), meddecide > Decision Curve
Analysis > Decision Curve Analysis) evaluates the clinical
utility of predicted probabilities (and optional binary clinical
decision rules) across a range of decision threshold probabilities
.
At threshold probability , a clinician treats if predicted risk , implicitly valuing a false positive as times a false negative:
A model shows clinical utility at only if its net benefit exceeds both default strategies: Treat None () and Treat All (, where is the observed event proportion).
Bundled dataset
dca_test_data contains 800 simulated patients with a
binary outcome (cardiac_event) and predicted risks from
several models (basic_model, enhanced_model,
biomarker_model, miscalibrated_model,
poor_model).
Open Cardiac Risk Models under File > Open > Data Library > meddecide to compare the saved analyses. In the custom-range example, open Analysis Options to see the 10% to 30% range in 5-percentage-point steps. Under Bootstrap and Resampling, compare the simultaneous confidence band with the default pointwise band. The Net interventions avoided plot compares each strategy with Treat All and expresses the difference in net benefit as equivalent interventions avoided per 100 patients. It is a trade-off measure, so its values can be negative.
Comparing risk models with bootstrap bands and pairwise tests
dca_res <- decisioncurve(
data = dca,
outcome = "cardiac_event",
outcomePositive = "Yes",
models = c("basic_model", "enhanced_model", "biomarker_model"),
decisionRulePositive = NULL,
thresholdRange = "clinical",
showTable = TRUE,
selectedThresholds = "0.05, 0.10, 0.15, 0.20, 0.30",
showPlot = TRUE,
showBenefitRange = TRUE,
showInterventionAvoided = TRUE,
confidenceIntervals = TRUE,
bootReps = 200,
seed = 42,
compareModels = TRUE
)
dca_res$resultsTable$asDF
#> threshold treat_all treat_none model_basic_model
#> "thresh_1" 0.05 0.09078947 0 0.082828947
#> "thresh_2" 0.10 0.04027778 0 0.051944444
#> "thresh_3" 0.15 -0.01617647 0 0.041029412
#> "thresh_4" 0.20 -0.07968750 0 0.021562500
#> "thresh_5" 0.30 -0.23392857 0 0.008571429
#> model_enhanced_model model_biomarker_model
#> "thresh_1" 0.095131579 0.091381579
#> "thresh_2" 0.065694444 0.060000000
#> "thresh_3" 0.040588235 0.037720588
#> "thresh_4" 0.028750000 0.022812500
#> "thresh_5" 0.005178571 0.007678571
dca_res$benefitRangeTable$asDF
#> model range_start range_end range_width
#> "model_1" basic_model 0.07 0.49 0.42
#> "model_2" enhanced_model 0.05 0.38 0.33
#> "model_3" biomarker_model 0.05 0.35 0.30
dca_res$comparisonTable$asDF
#> comparison weighted_auc_diff ci_lower
#> "pair_1" basic_model vs enhanced_model 7.931833e-05 -0.007067966
#> "pair_2" basic_model vs biomarker_model 1.277168e-03 -0.006763514
#> "pair_3" enhanced_model vs biomarker_model 1.197850e-03 -0.004323446
#> ci_upper p_value p_value_adj
#> "pair_1" 0.007417954 0.8855721 1
#> "pair_2" 0.009518753 0.7462687 1
#> "pair_3" 0.005953071 0.5870647 1
dca_res$dcaPlot
Adding a binary clinical decision rule
A binary rule (e.g., high-risk category yes/no) can be plotted and compared directly on the exact same complete-case cohort alongside continuous risk models:
dca$high_risk_rule <- factor(ifelse(dca$risk_category == "High", "Treat", "Observe"))
dca_rule <- decisioncurve(
data = dca,
outcome = "cardiac_event",
outcomePositive = "Yes",
models = c("basic_model", "biomarker_model"),
clinicalDecisionRule = TRUE,
decisionRuleVar = "high_risk_rule",
decisionRulePositive = "Treat",
decisionRuleLabel = "High-Risk Rule",
showBenefitRange = TRUE
)
dca_rule$benefitRangeTable$asDF
#> model range_start range_end range_width
#> "model_1" basic_model 0.07 0.49 0.42
#> "model_2" biomarker_model 0.05 0.35 0.30
#> "model_3" High-Risk Rule 0.11 0.28 0.17Interpreting decision curves safely
-
Calibration matters: Unlike AUC, net benefit
penalizes miscalibrated probabilities. Check model calibration
(
enhancedROC(..., calibrationAnalysis = TRUE)) before relying on a decision curve — comparingmiscalibrated_modelagainstbiomarker_modelillustrates how poor calibration can push net benefit below Treat None or Treat All. - Range of benefit, not an “optimal threshold”: Threshold probability encodes clinical preferences (relative harm of over-treatment vs. missed disease), not a parameter to optimize from the curve. Report the Range of Benefit where the model beats both default strategies, and verify that it covers clinically relevant thresholds.
-
Pointwise intervals and simultaneous bands:
Pointwise bootstrap intervals (
ciBand = "pointwise") describe sampling uncertainty separately at each threshold. A simultaneous band (ciBand = "simultaneous") targets joint coverage across the evaluated thresholds of one strategy. Its coverage is approximate, especially with sparse events.compareModels = TRUEadds exploratory paired bootstrap comparisons averaged across the threshold window with Holm-adjusted p-values. For a decision at a prespecified threshold, examine the net benefit at that threshold. Vickers et al. (2023) - No case-control prevalence transport: Net benefit and Treat All use the observed event proportion in the dataset. Recalibrating model probabilities does not change that denominator. Use a representative validation cohort or a method that weights the true- and false-positive rates by the target prevalence. Rousson and Zumbrunn (2011)
- Fixed-horizon binary outcomes only: Right-censored time-to-event data cannot be analyzed by dropping censored observations; use survival-specific decision curve methods when follow-up is incomplete.
- Apparent vs. external utility: When predicted risks were fitted on the same dataset, displayed net benefit is apparent and can be optimistic; validate on an independent cohort before clinical deployment.
See Choosing and interpreting an analysis for cross-module guidance.