Description Usage Arguments Format Value Note Author(s) References See Also Examples
View source: R/confusion_stat.R
Provides a confusion matrix of classification statistics following logistic regression.
1 | confusion_stat(pred=pred,obs=obs)
|
pred |
Predicted values |
obs |
Observed values |
The function has two arguments: predicted values, response values
confusion matrix
confusion_stat() 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 University, and Joseph M. Hilbe, Arizona State University
Hilbe, Joseph M. (2015), 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 11 12 | 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)
mu <- predict(mylogit, type="response")
cutpoint<-ROCtest(mylogit, fold=10, type="Sensitivity")$cut
mu[mu>=cutpoint]<-1
mu[mu<cutpoint]<-0
confusion_stat(mu, R84$outwork)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.