Skip to content

BUG: margins dummy incorrect if prepended constant - #3696

Merged
josef-pkt merged 3 commits into
statsmodels:masterfrom
josef-pkt:bug_margins_prepend_3695
May 25, 2017
Merged

josef-pkt merged 3 commits into
statsmodels:masterfrom
josef-pkt:bug_margins_prepend_3695

Conversation

@josef-pkt

@josef-pkt josef-pkt commented May 24, 2017 •

Copy link
Copy Markdown
Member

should close #3695

I didn't go through the full code path, checking if unit tests are fine on all machines.

does not include yet a possibly similar problem for _get_count_index

subclassing CheckMargEff in unit tests adds tests for count_index which fails for prepend=True case
using the same removal of the index adjustment fixes issues on my testing python

unit tests in CheckMargEff look pretty comprehensive, so I think it will be good to merge.

@josef-pkt josef-pkt added comp-discrete comp-genmod type-bug-wrong serious bugs that silently return incorrect numbers labels May 24, 2017
@coveralls

coveralls commented May 25, 2017 •

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.003%) to 90.429% when pulling 3ffad60 on josef-pkt:bug_margins_prepend_3695 into aed3187 on statsmodels:master.

@coveralls

coveralls commented May 25, 2017 •

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.003%) to 90.429% when pulling 15c1ec1 on josef-pkt:bug_margins_prepend_3695 into aed3187 on statsmodels:master.

@josef-pkt

Copy link
Copy Markdown
Member Author

all green, so I will merge tomorrow.

@josef-pkt

Copy link
Copy Markdown
Member Author

GLM doesn't have margins yet
GEE has margins but imports _get_dummy_index, _get_count_index from discrete, and delegates the core computation also to discrete margins.
unit test coverage for GEEMargins are only a few basic examples, I think the rest relies on correct computation in discrete margins.

@josef-pkt

josef-pkt commented May 25, 2017 •

Copy link
Copy Markdown
Member Author

I'm not sure what's going on with GEEMargins.
Trying to run the same kind of tests as for Logit results in errors and failures. It looks like dummy and count margins are not supported in GEEMargins.
e.g. GEE is missing model._derivative_predict which is used for both count and dummy effects.

(If this is so, then this is a separate issue and doesn't prevent merging this PR, and I'll move the added GEE unit test to a new PR)

edit I opened new issue for GEE Margin #3704

@josef-pkt

Copy link
Copy Markdown
Member Author

Good to merge then, given that GEE Margins have a separate problem and are not immediately affected by this.

@josef-pkt
josef-pkt merged commit 7b6c18a into statsmodels:master May 25, 2017
@josef-pkt josef-pkt modified the milestone: 0.9 May 26, 2017
@josef-pkt
josef-pkt deleted the bug_margins_prepend_3695 branch June 2, 2017 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-discrete comp-genmod type-bug-wrong serious bugs that silently return incorrect numbers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

logit marginal effects

2 participants