

def test_poisson_predict():
    data = sm.datasets.randhie.load()
    exog = sm.add_constant(data.exog, prepend=True)
    res = sm.Poisson(data.endog, exog).fit(method='newton', disp=0)
    pred1 = data.predict()
    pred2 = res.predict(exog)
    assert_almost_equal(pred1, pred2)
    pred3 = res.predict(exog, offset=0, exposure=1)
    assert_almost_equal(pred1, pred3)
    pred3 = res.predict(exog, offset=0, exposure=2)
    assert_almost_equal((2 * pred1), pred3)
    pred3 = res.predict(exog, offset=np.log(2), exposure=1)
    assert_almost_equal((2 * pred1), pred3)

dataset/ETHPy150Open statsmodels/statsmodels/statsmodels/discrete/tests/test_discrete.py test_poisson_predict/VarMisuse@62/79 `res`->`data`