
Last chance! 50% off unlimited learning
Sale ends in
Provides a Classification analysis for a logistic regression model. Also provides McFadden's Rsq.
ClassLog(MOD, resp, cut=.5)
Model of class glm where family is bonomial
response variable from data
Arbitrary cut for the proportion deemed '1' in model
A list containing: /CR
rawtab two-way table of classifications as frequencies
classtab two-way table of classifications as percentages
overall Overall percent classifications that are correct
mcFadden McFaddens pseudoRsq; 1 - ModelDeviance / NullDeviance
This is a primative function. I have a long to do list. For example, it is not yet written to handle missing observations.
# NOT RUN {
# create some data
x <- rnorm(100)
y <- as.numeric(cut(.5*x + rnorm(100), breaks=2))-1
tdf <- data.frame(x=x, y=y)
# run a logistic regression
glm1 <- glm(y ~ x, data=tdf, family=binomial)
# Get typical summary of results
summary(glm1)
# Classification Analysis
ClassLog(glm1, tdf$y)
# }
Run the code above in your browser using DataLab