Skip to content
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

Merged
merged 4 commits into from Jul 20, 2014

Conversation

Projects
None yet
3 participants
@kshedden
Copy link
Contributor

commented Jul 19, 2014

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.

@coveralls

This comment has been minimized.

Copy link

commented Jul 19, 2014

Coverage Status

Coverage increased (+0.01%) when pulling a4a7e36 on kshedden:gee_score into b2c1259 on statsmodels:master.

@coveralls

This comment has been minimized.

Copy link

commented Jul 19, 2014

Coverage Status

Coverage increased (+0.01%) when pulling a4a7e36 on kshedden:gee_score into b2c1259 on statsmodels:master.

cov_struct=va, constraint=(L, R))
rslt1 = mod1.fit()
assert_almost_equal(mod1.score_test_results["statistic"],
1.08126334)

This comment has been minimized.

Copy link
@josef-pkt

josef-pkt Jul 19, 2014

Member

add assert also for p-values?

Are these close to a Wald test, so we can have a coarse cross-check?

@kshedden

This comment has been minimized.

Copy link
Contributor Author

commented Jul 19, 2014

@coveralls

This comment has been minimized.

Copy link

commented Jul 20, 2014

Coverage Status

Coverage increased (+0.02%) when pulling cfef60e on kshedden:gee_score into b2c1259 on statsmodels:master.

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)

This comment has been minimized.

Copy link
@josef-pkt

josef-pkt Jul 20, 2014

Member

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)

@josef-pkt

This comment has been minimized.

Copy link
Member

commented Jul 20, 2014

notebook looks very good.

merging in spite of assert

josef-pkt added a commit that referenced this pull request Jul 20, 2014

@josef-pkt josef-pkt merged commit 3f49c10 into statsmodels:master Jul 20, 2014

2 checks passed

continuous-integration/appveyor AppVeyor build succeeded
Details
continuous-integration/travis-ci The Travis CI build passed
Details

@josef-pkt josef-pkt added the PR label Aug 11, 2014

@josef-pkt josef-pkt added this to the 0.6 milestone Aug 24, 2014

PierreBdR pushed a commit to PierreBdR/statsmodels that referenced this pull request Sep 2, 2014

@kshedden kshedden deleted the kshedden:gee_score branch Sep 27, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.