Re: [R] logistic regression: categorical value, and multinomial

From: John Fox <jfox_at_mcmaster.ca>
Date: Thu 28 Jul 2005 - 03:33:30 EST


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



John Fox
Department of Sociology
McMaster University
Hamilton, Ontario
Canada L8S 4M4
905-525-9140x23604
http://socserv.mcmaster.ca/jfox

> -----Original Message-----
> From: r-help-bounces@stat.math.ethz.ch
> [mailto:r-help-bounces@stat.math.ethz.ch] On Behalf Of Haibo Huang
> Sent: Wednesday, July 27, 2005 11:23 AM
> To: r-help@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



R-help@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 Received on Thu Jul 28 03:37:30 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:34:05 EST