You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
BUG/ENH: GEE Margins do not support dummy and count #3704
dummy=True in GEE Margins raises AttributeError: 'GEE' object has no attribute '_derivative_predict'
continuing example from 3696:
# check for GMM margins
import statsmodels.api as sm
groups = np.ones(x.shape[0], dtype=np.int32)
mod = sm.GEE(y, x, groups, family=sm.families.Binomial())
res_gee = mod.fit(cov_type='naive')
#mod._derivative_predict = mod._derivative_exog # try monkey patching with wrong method
me_gee = res_gee.get_margeff(at='mean', dummy = False)
me_gee_dummy = res_gee.get_margeff(at='mean', dummy=True)
dummy=False works
dummy=True is missing _derivative_predict
File "...\statsmodels\genmod\generalized_estimating_equations.py", line 1733, in get_margeff
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
return GEEMargins(self, (at, method, atexog, dummy, count))
File "...\statsmodels\genmod\generalized_estimating_equations.py", line 2528, in __init__
self.get_margeff(*args, **kwargs)
File "...\statsmodels\genmod\generalized_estimating_equations.py", line 2719, in get_margeff
method, 1)
File "...\statsmodels\discrete\discrete_margins.py", line 344, in margeff_cov_with_se
pass
File "...\statsmodels\discrete\discrete_margins.py", line 324, in margeff_cov_params
else:
File "...\statsmodels\discrete\discrete_margins.py", line 214, in _margeff_cov_params_dummy
dfdb = dfdb.mean(0)
AttributeError: 'GEE' object has no attribute '_derivative_predict'
Activity