Learn R Programming

ham (version 1.2.0)

decide: Statistics for Decision Curve Analysis and logistic regression model classification

Description

Calculate statistics such as sensitivity, specificity, positive and negative predictive values, and net benefit and interventions saved from a decision curve analysis.

Usage

decide(x, threshold)

Value

summary of model classification based on the selected threshold/cutoff, area under the curve (AUC)/c-statistic, predicted outcomes (transformed if applicable), decision curve analysis values at various percentiles, and sensitivity and specificity related statistics for the regression model at the specified threshold.

Arguments

x

assess regression object, currently logistic regression.

threshold

numeric vector of length == 1 that sets the threshold used to calculate sensitivity, specificity, positive and negative predictive values, and net benefit and interventions saved from a decision curve analysis. Select thresholds on appropriate linear scale such as logits for logistic regression models.

References

Vickers, A. & Elkin, E. (2006). Decision Curve Analysis: A Novel Method for Evaluating Prediction Models. Society for Medical Decision Making, 26, 6, 565-574. https://doi.org/10.1177/0272989X06295361

Examples

Run this code
## Predicting car engine shape type, v or straight  ##
# run the model
car_m1 <- assess(formula=vs ~ hp + am, data=mtcars, regression="logistic")
# create a decide object, enter the model name and a threshold on the logit scale
d1 <- decide(x=car_m1, threshold= -0.767)
# View model classification related statistics
print(d1$Model.Summary$Classification)

# View decision curve analysis results like 'net benefit' at various thresholds
print(d1$DCA)

Run the code above in your browser using DataLab