statsmodels / statsmodels

Statsmodels: statistical modeling and econometrics in Python
http://www.statsmodels.org/devel/
BSD 3-Clause "New" or "Revised" License
10.02k stars 2.87k forks source link

Linear Mixed Effects Models: can't find data of demo #6138

Open KaninchenM opened 5 years ago

KaninchenM commented 5 years ago

run Linear Mixed Effects Models as :

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

got the error: urllib.error.URLError: . When directly accessing the url: https://raw.githubusercontent.com/vincentarelbundock/Rdatasets/master/csv/geepack/, the response is '400: Invalid request'

emilmirzayev commented 5 years ago

Which version you use??

I could not replicate your issue with 0.10.1

data = getr("dietox", "geepack").data
   ...: md = smf.mixedlm("Weight ~ Time", data, groups=data["Pig"])
   ...: mdf = md.fit()
   ...: print(mdf.summary())
         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      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
========================================================