qroc: ROC plots in ggplot

Description Usage Arguments Value Author(s) Examples

Description

plot a ROC in ggplot for a given logistic regression fit.

Usage

1
qroc(fit, newdata = NULL, show.auc = FALSE, n = 200)

Arguments

a

glm object from a family = binomial

newdata

if omitted the data used to fit the model is used, else this newdata is passed to the predict function and the resulting ROC plot is based on this data.

show.auc

show the area under the curve on the plot via text.

n

number of thresholds to use, defualt is 200

Value

a list with the plot, the auc, and the data.frame used to plot the ROC

Author(s)

Peter DeWitt

Examples

1
2
3
4
5
fit <- glm(I(mpg > 15) ~ wt + cyl, data = mtcars,
           family = binomial(link = "logit"))
roc <- qrocc(fit)
roc$auc
roc$plot

dewittpe/qwraps documentation built on May 15, 2019, 5:07 a.m.