ClassLog | R Documentation |
Provides a Classification analysis for a logistic regression model. Also provides McFadden's Rsq.
ClassLog(MOD, resp, cut=.5)
MOD |
Model of class glm where family is bonomial |
resp |
response variable from data |
cut |
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.
Thomas D. Fletcher t.d.fletcher05@gmail.com
glm
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.