[R] Logistic Regression with 9 classes
Paul Johnson
pauljohn at ku.edu
Mon Dec 2 02:43:22 CET 2002
Hope this helps:
Your approach depends on your statistical theory.
If the 9 categories are ordered, the ordinal logistic (or probit) model
is called for. The first publication I know of that proposed it was R D
McKelvey and W Zavoina. A statistical model for the analysis of
ordinal level dependent variables.Journal of Mathematical Sociology,
4:103-120, 1975.
The idea is that the probability of falling into one category depends on
z=XB+e,
where e is either logistic or Normal, depending on your taste. THe
resulting estimates give you estimates of B as well as 8 "thresholds"
which divide the "z scale" into sections and relate to the predicted
outcome for the categories.
For that, the MASS packages has polr.
If the 9 categories are unordered, then some other statistical model
altogether is needed. One I know of is often called a multinomial model,
where you set one category as the baseline and then estimate the impact
of the variables to differentiate them from the baseline. For 9
cagegories, you'd end up with 8 models, of the sort
ln(Pj/P0) = Xbj, j=1,...8.
In MASS, the function multinom is for that purpose, but I have not tried it.
Luis Silva wrote:
> Hello!
>
> I need to classify a data set with 19 variables and 9 classes
> using Logistic Regression(on R).
> I know that when we have only 2 classes we can use glm() to
> estimate the coefficients of the model. But I don´t understand
> how can I do a classification task with Logistic Regression on
> a data set with 9 classes!
> Does anybody know how can I estimate these coefficients (of a
> model with 9 classes) on R?
>
> Thank you!
> Janete
>
--
Paul E. Johnson email: pauljohn at ukans.edu
Dept. of Political Science http://lark.cc.ku.edu/~pauljohn
University of Kansas Office: (785) 864-9086
Lawrence, Kansas 66045 FAX: (785) 864-5700
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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