diff --git a/statsmodels/genmod/tests/test_glm_weights.py b/statsmodels/genmod/tests/test_glm_weights.py index 9db40a2a484..2ad93ea2476 100644 --- a/statsmodels/genmod/tests/test_glm_weights.py +++ b/statsmodels/genmod/tests/test_glm_weights.py @@ -244,11 +244,9 @@ def setup_class(cls): nobs = len(cpunish_data.endog) aweights = fweights / wsum * nobs - # This is really close when corr_fact = (wsum - 1.) / wsum, but to - # avoid having loosen precision of the assert_allclose, I'm doing this - # manually. Its *possible* lowering the IRLS convergence criterion - # in stata and here will make this less sketchy. - cls.corr_fact = np.sqrt((wsum - 1.) / wsum) * 0.98518473599905609 + # Note: corr_fact here matches one of the two ways it can be defined + # in test_sandwich_cov. + cls.corr_fact = np.sqrt((nobs - 1.) / nobs) mod = GLM(cpunish_data.endog, cpunish_data.exog, family=sm.families.Poisson(), var_weights=aweights)