

def test_margeff_dummy(self):
    data = self.data
    vote = self.data['vote']
    exog = np.column_stack((data.exog, vote))
    exog = sm.add_constant(exog, prepend=False)
    res = MNLogit(data.endog, exog).fit(method='newton', disp=0)
    me = res.get_margeff(dummy=True)
    assert_almost_equal(me.margeff, self.res2.margeff_dydx_dummy_overall, 6)
    assert_almost_equal(me.margeff_se, self.res2.margeff_dydx_dummy_overall_se, 6)
    me = res.get_margeff(dummy=True, method='eydx')
    assert_almost_equal(me.margeff, self.res2.margeff_eydx_dummy_overall, 5)
    assert_almost_equal(me.margeff_se, self.res2.margeff_eydx_dummy_overall_se, 6)

dataset/ETHPy150Open statsmodels/statsmodels/statsmodels/discrete/tests/test_discrete.py CheckMNLogitBaseZero.test_margeff_dummy/VarMisuse@18/23 `data`->`self`