GEE formula interface does not take offset/exposure #1991

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

Projects

None yet

3 participants

@jseabold
Member

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
brentp 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 milestone: 0.7, 0.6 Sep 23, 2014
@josef-pkt
Member

Since it takes offset, this is not urgent

@josef-pkt josef-pkt closed this in f66de73 Sep 25, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment