Last active
March 20, 2021 05:23
-
-
Save jcheong0428/a1149d323c94141d5fb4699ccd30a8fc to your computer and use it in GitHub Desktop.
lmer1
This file contains hidden or 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
| !pip install -q statsmodels | |
| import numpy as np | |
| import pandas as pd | |
| import statsmodels.api as sm | |
| import statsmodels.formula.api as smf | |
| data = sm.datasets.get_rdataset('dietox', 'geepack').data | |
| md = smf.mixedlm("Weight ~ Time", data, groups=data["Pig"], re_formula="~Time") | |
| mdf = md.fit(method=["lbfgs"]) | |
| print(mdf.summary()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment