Skip to content

ENH Score test enhancements for GEE - #5435

Merged
kshedden merged 10 commits into
statsmodels:masterfrom
kshedden:gee-score-submodel
Feb 3, 2019
Merged

kshedden merged 10 commits into
statsmodels:masterfrom
kshedden:gee-score-submodel

Conversation

@kshedden

Copy link
Copy Markdown
Contributor

Allow the submodel to be provided as a fitted GEEResults object, instead of via a system of linear constraints.

@coveralls

coveralls commented Dec 23, 2018 •

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.02%) to 84.508% when pulling e319783 on kshedden:gee-score-submodel into 0558e51 on statsmodels:master.

@codecov

codecov Bot commented Dec 24, 2018

Copy link
Copy Markdown

Codecov Report

Merging #5435 into master will decrease coverage by 0.01%.
The diff coverage is 73.26%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5435      +/-   ##
==========================================
- Coverage   81.75%   81.74%   -0.02%     
==========================================
  Files         569      569              
  Lines       89824    89917      +93     
  Branches    10022    10033      +11     
==========================================
+ Hits        73440    73506      +66     
- Misses      14117    14135      +18     
- Partials     2267     2276       +9
Impacted Files Coverage Δ
statsmodels/genmod/tests/test_gee.py 98.97% <100%> (+0.02%) ⬆️
...smodels/genmod/generalized_estimating_equations.py 81.75% <63.51%> (-1.31%) ⬇️
statsmodels/stats/descriptivestats.py 24.34% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5b12177...37aa349. Read the comment docs.

@codecov

codecov Bot commented Dec 24, 2018 •

Copy link
Copy Markdown

Codecov Report

Merging #5435 into master will increase coverage by 0.01%.
The diff coverage is 88.28%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #5435      +/-   ##
=========================================
+ Coverage   81.98%     82%   +0.01%     
=========================================
  Files         586     586              
  Lines       92278   92398     +120     
  Branches    10240   10250      +10     
=========================================
+ Hits        75654   75768     +114     
- Misses      14279   14282       +3     
- Partials     2345    2348       +3
Impacted Files Coverage Δ
statsmodels/genmod/tests/test_gee.py 99% <100%> (+0.04%) ⬆️
...smodels/genmod/generalized_estimating_equations.py 82.88% <79.72%> (-0.23%) ⬇️
statsmodels/regression/mixed_linear_model.py 89.76% <0%> (+0.79%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0558e51...e319783. Read the comment docs.

return [np.array(array[self.group_indices[k], :])
for k in self.group_labels]

def score_test(self, submodel, tol=1e-6):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe rename to compare_score_test

I haven't looked at any details yet (still recovering from moving to a new house), but we should get consistent signature and interpretation for score_test.

I'm not sure whether score_test should be attached to the restricted model, the unrestricted model or both, depending on the options. (eg. I have an option for variable addition when the restricted model is available.)

for LR test we use compare_lr_test that takes a nested model.

@josef-pkt

Copy link
Copy Markdown
Member

IIUC, then the ii = _score_test_submodel(self, submodel.model, tol) only works for "zeros constraint", i.e. dropping/adding variables but not for general linear restrictions.

Kevin added a subspace check to OLS/RegressionModel compare_lm_test.
(In my version of the score_tests I don't check and assume that the user provides a nested model.)

@kshedden

kshedden commented Dec 28, 2018 via email

Copy link
Copy Markdown
Contributor Author

@kshedden
kshedden merged commit 7328267 into statsmodels:master Feb 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants