Learn R Programming

LOGIT (version 1.3)

ROCtest: 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

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

Arguments

model
model name
fold
number of k-folds
type
type of plot

Value

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.

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

Run this code
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")

Run the code above in your browser using DataLab