Skip to main content
edited tags
Link
Robert Long
  • 65.8k
  • 11
  • 133
  • 248
edited title
Link
J.A.Cado
  • 193
  • 1
  • 7

Interpreting the intercept of a Linear Mixed Model Results in Python - Statsmodel Package

Source Link
J.A.Cado
  • 193
  • 1
  • 7

Interpreting Linear Mixed Model Results in Python - Statsmodel Package

Using python package statsmodel and the code in this link:

If a linear mixed model has a random variable with x groups. then why when one would run this code:

data = sm.datasets.get_rdataset('dietox', 'geepack').data
md = smf.mixedlm("Weight ~ Time", data, groups=data["Pig"])
mdf = md.fit()
print(mdf.summary())

Does it only produce one value for the intercept parameter?

     Mixed Linear Model Regression Results
========================================================
Model:            MixedLM Dependent Variable: Weight
No. Observations: 861     Method:             REML
No. Groups:       72      Scale:              11.3669
Min. group size:  11      Log-Likelihood:     -2404.7753
Max. group size:  12      Converged:          Yes
Mean group size:  12.0
--------------------------------------------------------
             Coef.  Std.Err.    z    P>|z| [0.025 0.975]
--------------------------------------------------------
Intercept    15.724    0.788  19.952 0.000 14.179 17.268
Time          6.943    0.033 207.939 0.000  6.877  7.008
Group Var    40.394    2.149
========================================================

The table says that there are 72 different groups (in this case pigs). Yet the table only shows one intercept value, i.e.: 15.724

How do I interpret the table in relationship to what is happening "under the hood"? or in other words: How does that one value relate to the other 72 intercepts?