Last chance! 50% off unlimited learning
Sale ends in
Plot the components of the ROC curve --the true positive rates and false positive rates-- by high risk thresholds.
plot_roc_components(x, cost.benefit.axis = TRUE, n.cost.benefits = 6,
cost.benefits, confidence.intervals, col = "black", lty.fpr = 2,
lty.tpr = 1, lwd = 2, xlim, ylim, xlab = "Risk Threshold", ylab,
cost.benefit.xlab = "Cost:Benefit Ratio", legend.position = c("topright",
"right", "bottomright", "bottom", "bottomleft", "left", "topleft", "top",
"none"), ...)
decision_curve object to plot. Assumes output from function 'decision_curve'
logical (default TRUE) indicating whether to print an additional x-axis showing relative cost:benefit ratios in addition to risk thresholds.
number of cost:benefit ratios to print if cost.benefit.axis = TRUE (default n.cost.benefit = 6).
Character vector of the form c("c1:b1", "c2:b2", ..., "cn:bn") with integers ci, bi corresponding to specific cost:benefit ratios to print. Default allows the function to calculate these automatically.
logical indicating whether to plot confidence intervals.
vector of length two indicating the color for the true positive rates and false positive rates, respectively.
linetype for the false positive rate curve.
linetype for the true positive rate curve.
vector of linewidths. The first element corresponds to the tpr and the second to the fpr.
vector giving c(min, max) of x-axis. Defaults to c(min(thresholds), max(thresholds)).
vector giving c(min, max) of y-axis.
label of main x-axis.
label of y-axis.
label of cost:benefit ratio axis.
character vector giving position of legend. Options are "topright" (default), "right", "bottomright", "bottom", "bottomleft", "left", "topleft", "top", or "none".
other options directly send to plot()
# NOT RUN {
data(dcaData)
set.seed(123)
baseline.model <- decision_curve(Cancer~Age + Female + Smokes,
data = dcaData,
thresholds = seq(0, .4, by = .001),
bootstraps = 25) #should use more bootstrap replicates in practice!
#plot using the defaults
plot_roc_components(baseline.model, xlim = c(0, 0.4), col = c("black", "red"))
# }
Run the code above in your browser using DataLab