

def test_chisquare_effectsize():
    pr1 = np.array([1020, 690, 510, 420, 360])
    pr2 = np.array([1050, 660, 510, 420, 360])
    es_r = 0.02699815282115563
    es1 = chisquare_effectsize(pr1, pr2)
    es2 = chisquare_effectsize(pr1, pr2, cohen=False)
    assert_almost_equal(es1, es_r, decimal=14)
    assert_almost_equal(es2, (es_r ** 2), decimal=14)
    res1 = chisquare_effectsize(pr1, pr2, cohen=False, correction=(3000, (len(pr1) - 1)))
    res0 = 0
    assert_equal(res1, res0)
    pr3 = (pr2 + [0, 0, 0, 50, 50])
    res1 = chisquare_effectsize(pr1, pr3, cohen=False, correction=(3000, (len(pr1) - 1)))
    res0 = 0.0023106468846296755
    assert_almost_equal(res1, res0, decimal=14)

dataset/ETHPy150Open statsmodels/statsmodels/statsmodels/stats/tests/test_gof.py test_chisquare_effectsize/original