Skip to content

BUG corner case proportion_confint at zero and one #2609

Closed

Description

@josef-pkt

I get nans if the proportion is zero or one with Clopper-Pearson confidence interval.
There shouldn't be a problem returning 0 or 1 for the bound.
This is most likely an implication of how scipy.stats.distributions handles the corner cases. (There are some PRs in scipy to allow some corner cases.)

see #2608 (comment)

import statsmodels.stats.proportion as smprop
>>> smprop.proportion_confint(0, 18, method = 'beta', alpha=0.01)
(nan, 0.25498502848277477)

>>> smprop.proportion_confint(18, 18, method = 'beta', alpha=0.01)
(0.74501497151722496, nan)
``
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions