1234567891011121314151617181920 |
- # -*- coding: utf-8 -*-
- """
- Created on Tue Apr 9 11:11:14 2024
- @author: arefks
- """
- import numpy as np
- import pandas as pd
- import statsmodels.api as sm
- import statsmodels.formula.api as smf
- # grab the data/load data
- data = sm.datasets.get_rdataset("dietox", "geepack").data
- data.head()
- model = smf.mixedlm("Weight ~ Time",data,groups=data["Pig"])
- res = model.fit(method=["lbfgs"])
- res.summary()
|