[R] Logistic regression with more than two choices

Wuming Gong wuming.gong at gmail.com
Wed Jun 15 02:57:55 CEST 2005


Hi Koskinen

For response variables with multiple categories, you may try polr() in
MASS package, which implement a proportional odds model. And you may
search the R archives, several threads discussed this problem
before...

Wuming

On 6/15/05, Ville Koskinen <ville.koskinen at matrex.fi> wrote:
> Dear all R-users,
> 
> I am a new user of R and I am trying to build a discrete choice model (with
> more than two alternatives A, B, C and D) using logistic regression. I have
> data that describes the observed choice probabilities and some background
> information. An example below describes the data:
> 
> Sex     Age     pr(A)   pr(B)   pr(C)   pr(D) ...
> 1       11      0.5     0.5     0       0
> 1       40      1       0       0       0
> 0       34      0       0       0       1
> 0       64      0.1     0.5     0.2     0.2
> ...
> 
> I have been able to model a case with only two alternatives "A" and "not A"
> by using glm().
> 
> I do not know what functions are available to estimate such a model with
> more than two alternatives. Multinom() is one possibility, but it only
> allows the use of binary 0/1-data instead of observed probabilities. Did I
> understand this correctly?
> 
> Additionally, I am willing to use different independent variables for the
> different alternatives in the model. Formally, I mean that:
> Pr(A)=exp(uA)/(exp(uA)+exp(uB)+exp(uC)+exp(uD)
> Pr(B)=exp(uB)/(exp(uA)+exp(uB)+exp(uC)+exp(uD)
> ...
> where uA, uB, uC and uD are linear functions with different independent
> variables, e.g. uA=alpha_A1*Age, uB=alpha_B1*Sex.
> 
> Do you know how to estimate this type of models in R?
> 
> Best regards, Ville Koskinen
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>




More information about the R-help mailing list