How to have multiple groups in Python statsmodels linear mixed effects model?

后端 未结 2 692
别那么骄傲
别那么骄傲 2021-02-10 11:25

I am trying to use the Python statsmodels linear mixed effects model to fit a model that has two random intercepts, e.g. two groups. I cannot figure out how to initialize the m

2条回答
  •  走了就别回头了
    2021-02-10 12:04

    Multiple or crossed random intercepts crossed effects can be fit using variance components, which are implemented in a different way from the one-group mixed effects.

    I don't find an example, and the documentation seems to be only partially updated.

    The unit tests contain an example using the MixedLM formula interface:

    https://github.com/statsmodels/statsmodels/blob/master/statsmodels/regression/tests/test_lme.py#L284

提交回复
热议问题