[R] classification table in logistic regression
Thomas Lumley
tlumley at u.washington.edu
Wed Sep 4 18:02:10 CEST 2002
On Wed, 4 Sep 2002 idimakos at upatras.gr wrote:
> Friends,
>
> Is there an option (or options) to produce a classification table when
> running a logistic regression analysis? Similar to the ctable option in
> proc logistic in SAS?
>
If you have a binary outcome it's very simple
table(model$y,fitted(model)>threshold)
where threshold is the threshold for deciding whether a fitted value
should go to 1 or 0. One natural default is
threshold<-mean(fitted(model))
which makes the overall observed and predicted numbers equal.
-thomas
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list