Skip to content

add 2 methods with continuity correction (CC) - #3211

Open
Jiangtang wants to merge 2 commits into
statsmodels:mainfrom
Jiangtang:master
Open

Jiangtang wants to merge 2 commits into
statsmodels:mainfrom
Jiangtang:master

Conversation

@Jiangtang

Copy link
Copy Markdown
  1. add 2 methods with continuity correction (CC) for Normal and Wilson methods respectively;
  2. add the paper of Newcombe on single proportion which is the mostly sited paper on this topic.
  3. cosmetic changes.

add 2 methods with continuity correction (CC) for Normal and Wilson
methods respectively; add paper of Newcombe; cosmetic changes.

@josef-pkt josef-pkt left a comment

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.

@Jiangtang Thanks and sorry for the delay in responding

based on a brief review:

overall looks like a good extension
this need unit tests, preferably against R or another stats package

I don't really like the code duplication in the two new methods. The calculations for wilson look different but I didn't try to figure it out. I think we could just use something like method.endswith('_cc') and then add the continuity correction to the current methods.
and replace the current condition with method.startswith or similar.

ci_low = q_ - dist
ci_upp = q_ + dist

if method == 'normal_cc':

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.

this should be elif unit tests on travis fail because of it.

- `beta` : Clopper-Pearson interval based on Beta distribution
- `beta` : Clopper-Pearson interval based on Beta distribution, or Exact method
- `wilson` : Wilson Score interval
- `wilson_cc` : Wilson Score interval with continuity correction

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.

I think API with separate methods is fine. The alternative of adding a "continuity correction" keyword wouldn't apply generally enough.

@josef-pkt josef-pkt added this to the 0.9 milestone Sep 29, 2016
@josef-pkt josef-pkt modified the milestones: 0.9, 0.14 Feb 17, 2022
@josef-pkt josef-pkt mentioned this pull request Feb 17, 2022
16 of 20 tasks
@josef-pkt josef-pkt modified the milestones: 0.14, 0.15 Nov 30, 2022
@josef-pkt

Copy link
Copy Markdown
Member

bump for 0.15, together with some proportion refactorings #6721

@josef-pkt

Copy link
Copy Markdown
Member

unit tests are missing

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.

2 participants