Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GEE requires exact import for cov_struct #2025

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

Comments

Projects
None yet
3 participants
@brentp
Copy link

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

This comment has been minimized.

Copy link
Contributor

commented Oct 4, 2014

This was a recent change, discussion here:

#1981

@josef-pkt

This comment has been minimized.

Copy link
Member

commented Oct 4, 2014

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

This comment has been minimized.

Copy link
Author

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
You can’t perform that action at this time.