简体   繁体   English

R +多级Logistic回归+组固定效应

[英]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 ): 在Stata中,我知道如果使用以下命令,则可以获取因变量( thkbins )和两个预测变量( cctv )之间每种可能组合的对数:

melogit thkbins cc#tv || school:,

在此处输入图片说明

Is there a way to produce a similar output in R? 有没有办法在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. 我一直在使用lme4软件包中的glmer命令,尽管我可以使用交互项获得输出,但这并不是我可以在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 ): 我会用clmm从包ordinal (教程这里 ):

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

I hope this helps. 我希望这有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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