ClassLog {QuantPsyc} | R Documentation |
Classification for Logistic Regression
Description
Provides a Classification analysis for a logistic regression model. Also provides McFadden's Rsq.
Usage
ClassLog(MOD, resp, cut=.5)
Arguments
MOD |
Model of class glm where family is bonomial |
resp |
response variable from data |
cut |
Arbitrary cut for the proportion deemed '1' in model |
Value
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
Warning
This is a primative function. I have a long to do list. For example, it is not yet written to handle missing observations.
Author(s)
Thomas D. Fletcher t.d.fletcher05@gmail.com
See Also
Examples
# 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)
[Package QuantPsyc version 1.6 Index]