GEE requires exact import for cov_struct #2025

Closed
brentp opened this Issue Oct 3, 2014 · 3 comments

Projects

None yet

3 participants

@brentp
brentp commented Oct 3, 2014

As of a recent commit,
If I import 'Exchangeable' from statsmodels.genmod.cov_struct, everything is OK.

If I import Exchangeable from from statsmodels.genmod.dependence_structures

I get the error

  File "/usr/local/lib/python2.7/dist-packages/statsmodels-0.6.0-py2.7-linux-x86_64.egg/statsmodels/genmod/generalized_estimating_equations.py", line 446, in __init__
    "cov_struct instance: %s" % cov_struct )
ValueError: GEE: `cov_struct` must be a genmod cov_struct instance

Here is code to reproduce with m.csv from mailing list

import pandas as pd
from statsmodels.genmod.dependence_structures import Exchangeable
df = pd.read_csv('m.csv')

import statsmodels.api as sm

from statsmodels.genmod.cov_struct import Exchangeable
print sm.GEE.from_formula('methylation ~ age + gender + asthma', 'id',
        df, cov_struct=Exchangeable()).fit().summary()

from statsmodels.genmod.dependence_structures import Exchangeable

print sm.GEE.from_formula('methylation ~ age + gender + asthma', 'id',
        df, cov_struct=Exchangeable()).fit().summary()
@kshedden
Contributor
kshedden commented Oct 4, 2014

This was a recent change, discussion here:

#1981

@josef-pkt
Member

from statsmodels.genmod.dependence_structures import Exchangeable
should raise an ImportError with master.

Maybe you got stale .pyc files in your checkout when you work directly from the checkout.
(as I have)

@brentp
brentp commented Oct 4, 2014

aye, stale .pyc
thanks.

@brentp brentp closed this Oct 4, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment