Skip to content

Commit

Permalink
add example
Browse files Browse the repository at this point in the history
  • Loading branch information
mdbrown committed Jan 13, 2016
1 parent 37ba027 commit fd316fe
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
17 changes: 16 additions & 1 deletion R/cv_decision_curve.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,22 @@
#' @seealso \code{\link{summary.decision_curve}}, \code{\link{decision_curve}}, \code{\link{Add_CostBenefit_Axis}}
#' @examples
#'
#' #todo
#' full.model_cv <- cv_decision_curve(Cancer~Age + Female + Smokes + Marker1 + Marker2,
#' data = dcaData,
#' folds = 5,
#' thresholds = seq(0, .4, by = .01))
#'
#'full.model_apparent <- decision_curve(Cancer~Age + Female + Smokes + Marker1 + Marker2,
#' data = dcaData,
#' thresholds = seq(0, .4, by = .01),
#' confidence.intervals = 'none')
#'
#'plot_decision_curve( list(full.model_apparent, full.model_cv),
#' curve.names = c("Apparent curve", "Cross-validated curve"),
#' col = c("red", "blue"),
#' lty = c(2,1),
#' lwd = c(3,2, 2, 1),
#' legend.position = "bottomright")
#'
#' @importFrom caret createFolds
#' @export
Expand Down
2 changes: 1 addition & 1 deletion inst/notes/tutorial.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ output:

Decision curves are a useful tool to evaluate the population impact of adopting a risk prediction instrument into clinical practice. Given one or more instruments (risk models) that predict the probability of a binary outcome, this package calculates and plots decision curves, which display estimates of the standardized net benefit by the probability threshold used to categorize observations as 'high risk.' Curves can be estimated using data from an observational cohort, or from case-control studies when an estimate of the population outcome prevalence is available.

Confidence intervals calculated using the bootstrap can be displayed and a wrapper function to calculate cross-validated curves using k-fold cross-validation is also included.
Confidence intervals calculated using the bootstrap can be displayed and a wrapper function to calculate cross-validated curves using k-fold cross-validation is also provided.

## Install the package

Expand Down

0 comments on commit fd316fe

Please sign in to comment.