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 formula interface does not take offset/exposure #1991

Closed
jseabold opened this issue Sep 23, 2014 · 2 comments

Comments

Projects
None yet
3 participants
@jseabold
Copy link
Member

commented Sep 23, 2014

Mentioned on mailing list.

@jseabold jseabold added this to the 0.6 milestone Sep 23, 2014

@josef-pkt josef-pkt referenced this issue Sep 23, 2014

Closed

release 0.6 #912

11 of 25 tasks complete
@brentp

This comment has been minimized.

Copy link

commented Sep 23, 2014

see: https://groups.google.com/forum/#!topic/pystatsmodels/yiSFwg4A7MQ

it does take offset, but it does not take exposure.
With the csv here: https://groups.google.com/group/pystatsmodels/attach/2c32f40885757f83/ex.cluster.csv?part=0.1&authuser=0&view=1

the code below works for offset but not for exposure (though in the former case it does return nan's for the estimates).

import numpy as np
import pandas as pd
from statsmodels.api import GLM, GEE
from statsmodels.genmod.families import Poisson
from statsmodels.genmod.dependence_structures import Exchangeable, Independence

c = pd.read_csv('Downloads/ex.cluster.csv')
# c = c[c['counts'] > 0]

print GEE.from_formula("methylation ~ Eos + trt", c['id'], c,
        offset=np.log(c['counts']), family=Poisson(),
        cov_struct=Exchangeable()).fit(maxiter=600).summary()

print GEE.from_formula("methylation ~ Eos + trt", c['id'], c,
        exposure=c['counts'], family=Poisson(),
        cov_struct=Exchangeable()).fit(maxiter=600).summary()

@josef-pkt josef-pkt modified the milestones: 0.7, 0.6 Sep 23, 2014

@josef-pkt

This comment has been minimized.

Copy link
Member

commented Sep 23, 2014

Since it takes offset, this is not urgent

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.