# 决策曲线(Decision Curve Analysis)绘制

1. 背景知识

2. 案例分析

3. R代码及结果解读

#install.packages("rmda")
library(rmda)
Data<-read.csv('2.20.Framingham.csv',sep = ',')

DCA模型构建

simple<- decision_curve(chdfate~scl,data= Data,
family = binomial(link ='logit'),
thresholds= seq(0,1, by = 0.01),
confidence.intervals = 0.95,
study.design = 'case-control',
population.prevalence = 0.3)
## Warning in decision_curve(chdfate ~ scl, data = Data, family =
## binomial(link = "logit"), : 33 observation(s) with missing data removed
## Calculating net benefit curves for case-control data. All calculations are done conditional on the outcome prevalence provided.

complex<-decision_curve(chdfate~scl+sbp+dbp+age+bmi+sex,
data = Data,family = binomial(link ='logit'),
thresholds = seq(0,1, by = 0.01),
confidence.intervals= 0.95,
study.design = 'case-control',
population.prevalence= 0.3)
## Warning in decision_curve(chdfate ~ scl + sbp + dbp + age + bmi + sex, data
## = Data, : 41 observation(s) with missing data removed
## Calculating net benefit curves for case-control data. All calculations are done conditional on the outcome prevalence provided.
## Note:  The data provided is used to both fit a prediction model and to estimate the respective decision curve. This may cause bias in decision curve estimates leading to over-confidence in model performance.

List<- list(simple,complex)

DCA曲线绘制

plot_decision_curve() 函数的对象就是前面定义的List，如果只画一条曲线，直接把List替换成simple或complex即可。#curve.names是出图时，图例上每条曲线的名字，书写顺序要跟上面合成list时一致。cost.benefit.axis是另外附加的一条横坐标轴，损失收益比，默认值是TRUE，所在不需要时要记得设为FALSE。col设置颜色。confidence.intervals设置是否画出曲线的置信区间，standardize设置是否对净受益率（NB）使用患病率进行校正。可得如图2.所示曲线。

plot_decision_curve(List,
curve.names=c('simple','complex'),
cost.benefit.axis =FALSE,col= c('red','blue'),
confidence.intervals=FALSE,
standardize = FALSE)
## Note: When multiple decision curves are plotted, decision curves for 'All' are calculated using the prevalence from the first DecisionCurve object in the list provided.

summary(complex,measure= 'NB')

plot_clinical_impact(simple,population.size= 1000,
cost.benefit.axis = T,
n.cost.benefits= 8,
col =c('red','blue'),
confidence.intervals= T,
ylim=c(0,1000),
legend.position="topright")

plot_clinical_impact(complex,population.size= 1000,
cost.benefit.axis = T,
n.cost.benefits= 8,col =c('red','blue'),
confidence.intervals=T,
ylim=c(0,1000),
legend.position="topright")

4. 参考文献

[1]. Decision curve analysis: anovel methodfor evaluating prediction models

[2].Decision curve analysisrevisited:overall net benefit, relationships to ROC curve analysis, andapplication tocase-control studies

[3].Assessing the Clinical Impactof RiskPrediction Models With Decision Curves: Guidance for CorrectInterpretation andAppropriate Use

[4]. https://www.plob.org/article/12455.html 决策曲线分析法（Decision Curve Analysis, DCA）

[5].https://www.mskcc.org/departments/epidemiology-biostatistics/health-outcomes/decision-curve-analysis-01

[6]. https://github.com/mdbrown/rmda/releases

• 版权声明 本文源自 临床研究与医学统计 整理整理发表
• 除非特殊声明，本站文章均为原创，转载请务必保留本文链接