Last active
December 18, 2020 19:47
-
-
Save smazzanti/cba733b0fa9631c3f79e1aa28a20bb22 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
model = smf.mixedlm(formula = 'y ~ 1', data = y.to_frame(), groups = x).fit() | |
intercept = model.params['Intercept'] | |
random_effect = x.replace({k: float(v) for k, v in model.random_effects.items()}) | |
glmm_encoding = intercept + random_effect |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment