Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ddsjoberg/dcurves
Decision Curve Analysis
https://github.com/ddsjoberg/dcurves
decision-curve-analysis r r-package rstats
Last synced: 3 days ago
JSON representation
Decision Curve Analysis
- Host: GitHub
- URL: https://github.com/ddsjoberg/dcurves
- Owner: ddsjoberg
- License: other
- Created: 2018-03-26T13:50:26.000Z (almost 7 years ago)
- Default Branch: main
- Last Pushed: 2024-07-23T23:22:19.000Z (6 months ago)
- Last Synced: 2025-01-06T14:18:31.674Z (10 days ago)
- Topics: decision-curve-analysis, r, r-package, rstats
- Language: R
- Homepage: http://www.danieldsjoberg.com/dcurves/
- Size: 6.17 MB
- Stars: 37
- Watchers: 3
- Forks: 14
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- Changelog: NEWS.md
- License: LICENSE
Awesome Lists containing this project
README
---
output: github_document
---```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
fig.height = 3,
out.width = "100%"
)
```[![R-CMD-check](https://github.com/ddsjoberg/dcurves/workflows/R-CMD-check/badge.svg)](https://github.com/ddsjoberg/dcurves/actions)
[![Codecov test coverage](https://codecov.io/gh/ddsjoberg/dcurves/branch/main/graph/badge.svg)](https://app.codecov.io/gh/ddsjoberg/dcurves?branch=main)
[![CRAN status](https://www.r-pkg.org/badges/version/dcurves)](https://cran.r-project.org/package=dcurves)# Decision Curve Analysis
Diagnostic and prognostic models are typically evaluated with measures of accuracy that do not address clinical consequences.
Decision-analytic techniques allow assessment of clinical outcomes but often require collection of additional information and may be cumbersome to apply to models that yield a continuous result.
Decision curve analysis is a method for evaluating and comparing prediction models that incorporates clinical consequences, requires only the data set on which the models are tested, and can be applied to models that have either continuous or dichotomous results.The **dcurves** package includes methods for evaluating predictive models with binary (Vickers and Elkin 2006) and time-to-event endpoints (Vickers et al. 2008).
The package also includes methods for model evaluation in the case-control setting (Pfeiffer and Gail 2020).## Installation
You can install dcurves from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("ddsjoberg/dcurves")
```
## ExamplesAssess models predicting binary endpoints.
```{r example1}
library(dcurves)dca(cancer ~ cancerpredmarker + famhistory,
data = df_binary,
thresholds = seq(0, 0.35, by = 0.01),
label = list(cancerpredmarker = "Prediction Model",
famhistory = "Family History")) %>%
plot(smooth = TRUE)
```Time-to-event or survival endpoints
```{r example2}
dca(Surv(ttcancer, cancer) ~ cancerpredmarker,
data = df_surv,
time = 1,
thresholds = seq(0, 0.50, by = 0.01),
label = list(cancerpredmarker = "Prediction Model")) %>%
plot(smooth = TRUE)
```Create a customized DCA figure by first printing the ggplot code.
Copy and modify the ggplot code as needed.```{r show_code}
gg_dca <-
dca(cancer ~ cancerpredmarker,
data = df_binary,
thresholds = seq(0, 0.35, by = 0.01),
label = list(cancerpredmarker = "Prediction Model")) %>%
plot(smooth = TRUE, show_ggplot_code = TRUE)
```## References
Pfeiffer, Ruth M, and Mitchell H Gail. (2020)
"Estimating the Decision Curve and Its Precision from Three Study Designs."
*Biometrical Journal* 62 (3): 764–76.Vickers, Andrew J, Angel M Cronin, Elena B Elkin, and Mithat Gonen.
(2008)"Extensions to Decision Curve Analysis, a Novel Method for Evaluating Diagnostic Tests, Prediction Models and Molecular Markers."
*BMC Medical Informatics and Decision Making* 8 (1): 1–17.Vickers, Andrew J, and Elena B Elkin. (2006)
"Decision Curve Analysis: A Novel Method for Evaluating Prediction Models."
*Medical Decision Making* 26 (6): 565–74.