New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG: GEE score #1839
BUG: GEE score #1839
Conversation
cov_struct=va, constraint=(L, R)) | ||
rslt1 = mod1.fit() | ||
assert_almost_equal(mod1.score_test_results["statistic"], | ||
1.08126334) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add assert also for p-values?
Are these close to a Wald test, so we can have a coarse cross-check?
Additional testing in this notebook: http://nbviewer.ipython.org/urls/umich.box.com/shared/static/mlc77aixvwl43xe9vvjf.ipynb |
wald_z = np.dot(f, rslt0.params) / se | ||
wald_p = 2*norm.cdf(-np.abs(wald_z)) | ||
score_p = mod1.score_test_results["p-value"] | ||
assert(np.abs(wald_p - score_p) < 0.02) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same but better is assert_allclose(wald_p, score_p, atol=0.02)
(more informative failure message, and assert get optimized away in byte compiling python code with option -o)
notebook looks very good. merging in spite of assert |
BUG: GEE score
Fixes a bug in GEE score test that crept in somewhere during refactoring. There was previously no test coverage for GEE score testing. I added a simple regression test here.