Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
265 views
in Technique[技术] by (71.8m points)

python - Statsmodels LME with two random effects?

I am new to statsmodels in Python (I used to do these in R). The code below works but it has only one random slope. I need to add one more random slope (with another variable called ROM; currently the slope belongs to LCdev455 and ResponderID, but I want to add another slope. I would have writen it like this: LCdev455|ROM in R) but I could not find how from the statsmodels documents.

model1S = "Ratings ~ LCdev455"
model1S_lme = MixedLM.from_formula(model1S, groups=data["ResponderID"], data=data, re_formula='~LCdev455')
model1S_lme= model1S_lme.fit()
model1S_lme.summary()

Many thanks in advance,


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...