GEE formula interface does not take offset/exposure #1991

jseabold opened this Issue Sep 23, 2014 · 2 comments


None yet

3 participants


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

release 0.6 #912

11 of 25 tasks complete
brentp commented Sep 23, 2014


it does take offset, but it does not take exposure.
With the csv here:

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(),

print GEE.from_formula("methylation ~ Eos + trt", c['id'], c,
        exposure=c['counts'], family=Poisson(),
@josef-pkt josef-pkt modified the milestone: 0.7, 0.6 Sep 23, 2014

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