I was practising codes from the textbook, "Discovering Statistics using R".
I wonder if running two binary logistic regression can be another way of running one multinomial logistic regression.
I tried multinomial logistic regression with multinom
, but getting the influential data points was difficult.
I understand that multinomial logistic regression runs binary logistic regression for k-1 categories.
So, I ran two binary logistic regressions, but I got slightly different coefficients from that of the multinomial.
I got the datasets from datasets, "Chat-Up Lines.dat"
I reorganized the original dataset into three datasets, each containing only one category and combined two categories of data (base and response). Then I applied glm
to each data.
Here is the code.
noResponseOnly <- subset(chatData,Success=="No response/Walk Off")
getPhonenumOnly <- subset(chatData,Success=="Get Phone Number")
goHomeOnly <- subset(chatData,Success=="Go Home with Person")
PhoneBase <- rbind(noResponseOnly,getPhonenumOnly)
HomeBase <- rbind(noResponseOnly,goHomeOnly)
# two models using binary logit regression
phoneModel.2 <- glm(Success ~ Good_Mate + Funny + Gender + Sex + Gender*Sex + Funny*Gender,na.action = na.omit,data = PhoneBase,family = binomial())
summary(phoneModel.2)
homeModel.2 <- glm(Success ~ Good_Mate + Funny + Gender + Sex + Gender*Sex + Funny*Gender,na.action = na.omit,data = HomeBase,family = binomial())
summary(homeModel.2)
# the model using multinom()
chatModel <- multinom(Success~Good_Mate + Funny + Gender + Sex + Gender*Sex + Funny*Gender, data=chatData)
summary(chatModel,Wald=TRUE)
The outcomes were
> exp(phoneModel.2$coefficients)
(Intercept) Good_Mate Funny
0.1049014 1.1404107 1.1270241
Gender[T.Female] Sex Gender[T.Female]:Sex
0.3001970 1.4450642 0.6448238
Funny:Gender[T.Female]
1.6775339
> exp(homeModel.2$coefficients)
(Intercept) Good_Mate Funny
0.03926519 1.11299595 1.33931116
Gender[T.Female] Sex Gender[T.Female]:Sex
0.00105268 1.32339001 0.69539254
Funny:Gender[T.Female]
3.58605635
> exp(coef(chatModel))
(Intercept) Good_Mate Funny Gender[T.Female] Sex
Get Phone Number 0.16812119 1.140922 1.149566 0.192781497 1.318121
Go Home with Person 0.01375542 1.138829 1.375005 0.003602029 1.517841
Gender[T.Female]:Sex Funny:Gender[T.Female]
Get Phone Number 0.7058655 1.636318
Go Home with Person 0.6208551 3.229770
So there's a little difference between the models. I'm not sure what causes this discrepancy.