简体   繁体   中英

R + Multilevel Logistic Regression + Group Fixed Effects

In Stata, I know that if I use the following command, I can get the logits for each possible combination between my dependent variable ( thkbins ) and my two predictor variables ( cc & tv ):

melogit thkbins cc#tv || school:,

在此处输入图片说明

Is there a way to produce a similar output in R? I have been using the glmer command from the lme4 package, and while I can get the output with the interaction term, it isn't exactly what I can produce in Stata.

model1 <- glmer(thkbin ~ cc + tv + cc*tv + (1|school),
            data=thkdata, family = binomial, nAGQ = 7)
summary(model1)

在此处输入图片说明

I would use clmm from the package ordinal (tutorial here ):

model<-clmm(DepVar~IndVar+(1|WithinVar),data=df)

I hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM