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
number of k-folds
type of plot
The function has three arguments: modelname, folds, type of plot
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.
ROCtest() must be loaded into memory in order to be effectve. As a function in LOGIT, it is immediately available to a user.
Rafael de Souza, ELTE, Hungary, Joseph M. Hilbe, Arizona State University.
Hilbe, Joseph M. (2016), Practical Guide to Logistic Regression, Chapman & Hall/CRC. Hilbe, Joseph M. (2009), Logistic Regression Models, Chapman & Hall/CRC.
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.