[R] logistic regression: categorical value, and multinomial

John Fox jfox at mcmaster.ca
Wed Jul 27 19:33:30 CEST 2005

Dear Ed,

See ?glm for fitting binomial logit models, and ?multinom (in the nnet
package) for multinomial logit models. Neither function will handle a
character ("text") variable as the response, but you could easily convert
the variable to a factor.


John Fox
Department of Sociology
McMaster University
Hamilton, Ontario
Canada L8S 4M4

> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch 
> [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Haibo Huang
> Sent: Wednesday, July 27, 2005 11:23 AM
> To: r-help at stat.math.ethz.ch
> Subject: [R] logistic regression: categorical value, and multinomial
> I have two questions:
> 1. If I want to do a binomial logit, how to handle the 
> categorical response variable? Data for the response 
> variables are not numerical, but text.
> 2. What if I want to do a multinomial logit, still with 
> categorical response variable? The variable has 5 
> non-numerical response levels, I have to do it with a 
> multinomial logit.
> Any input is highly appreciated! Thanks!
> Ed

More information about the R-help mailing list