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 r
> d<-data.frame(y=sample(letters[1:2],100,T),x=rnorm(100))
> head(d,10)
y x
1 b 0.55915620
2 b 0.87575380
3 b -0.13093156
4 b 0.75925729
5 b 0.40233427
6 b 1.34685918
7 a 1.10487752
8 a -2.27456596
9 a 1.65919787
10 b 0.05095611
> glm(y~x,data=d,family=binomial)
Call
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