Display ROC curve and related AUC statistic, or sensitivity-specificity plot of glm with binomial family.

Description

Provides two options following the glm() function with binomial family. 1: Senstivity-specificity plot with optimal cut point statistic 2: ROC plot with Area Under Curve (AUC) statistic

Usage

1
ROCtest(model= model, fold=10, type=c("ROC","Sensitivity"))

Arguments

model

model name

fold

number of k-folds

type

type of plot

Format

x

The function has three arguments: modelname, folds, type of plot

Details

ROCtest is a post-estimation function for logistic regression, following the use of glm(). Options to display a sensitivity-specificity plot or ROC curve are available.

Value

plot

Note

ROCtest() must be loaded into memory in order to be effectve. As a function in LOGIT, it is immediately available to a user.

Author(s)

Rafael de Souza, ELTE, Hungary, Joseph M. Hilbe, Arizona State University.

References

Hilbe, Joseph M. (2016), Practical Guide to Logistic Regression, Chapman & Hall/CRC. Hilbe, Joseph M. (2009), Logistic Regression Models, Chapman & Hall/CRC.

See Also

glm

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
library(MASS)
 library(LOGIT)
 data(R84)
 R84$cage <- R84$age - mean(R84$age)
 R84$cdoc <- R84$docvis - mean(R84$docvis)
 mylogit <- glm(outwork ~ cdoc + female + kids + cage + factor(edlevel),
 family=binomial, data=R84)
 summary(mylogit)
 ROCtest(mylogit, fold=10, type="Sensitivity")
 ROCtest(mylogit, fold=10, type="ROC")