Skip to content

Fixed bug with shifting at zero value in contingency table - #3603

Closed
evgenyzhurko wants to merge 2 commits into
statsmodels:masterfrom
evgenyzhurko:fix-contingency-table
Closed

evgenyzhurko wants to merge 2 commits into
statsmodels:masterfrom
evgenyzhurko:fix-contingency-table

Conversation

@evgenyzhurko

Copy link
Copy Markdown
Contributor

@coveralls

coveralls commented Apr 9, 2017 •

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.003%) to 90.299% when pulling d3a195e on evgenyzhurko:fix-contingency-table into a218660 on statsmodels:master.

[3, 0.5, 4],
[5, 6, 0.5]], dtype=np.float64)
assert_equal(ctab.Table(t, shift_zeros=True).table, r)

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.

add an assert here that checks the default.
assert_equal(ctab.Table(t).table, r)

@josef-pkt

Copy link
Copy Markdown
Member

@evgenyzhurko Thanks, PR looks good to me. One extra assert for the default.

One open question is whether we want to extend the options for zeros or continuity corrections, and what the default should be. But I don't know yet what would be useful. (One general possibility which doesn't fit the class structure so well is to put corrections into individual hypothesis tests or similar methods instead of changing the underlying contingency table.)
This PR matches code to docstring.

@kshedden any opinion on this?

@coveralls

coveralls commented Apr 9, 2017 •

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.003%) to 90.299% when pulling 81f228d on evgenyzhurko:fix-contingency-table into a218660 on statsmodels:master.

@josef-pkt josef-pkt added this to the 0.9 milestone Jul 24, 2017
@josef-pkt

Copy link
Copy Markdown
Member

@kshedden I would like to have a decision on the default handling of zeros for 0.9 (given that it is the first release after contingency table was introduced)

@bashtage bashtage self-assigned this May 8, 2019
@bashtage bashtage mentioned this pull request May 8, 2019
4 tasks done
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.

4 participants