diff_binom_confint.compute_confidence_interval#

diff_binom_confint.compute_confidence_interval(n_positive: int, n_total: int, conf_level: float = 0.95, method: str = 'wilson', clip: bool = True, sides: str | int = 'two-sided') ConfidenceInterval[source]#

Compute the confidence interval for a binomial proportion.

Parameters:
  • n_positive (int) – Number of positive samples.

  • n_total (int) – Total number of samples.

  • conf_level (float, default 0.95) – Confidence level, should be inside the interval (0, 1).

  • method (str, default "wilson") – Type (computation method) of the confidence interval.

  • clip (bool, default True) – Whether to clip the confidence interval to the interval (0, 1).

  • sides (str or int, default "two-sided") –

    Sides of the confidence interval, should be one of

    • ”two-sided” (aliases “2-sided”, “two_sided”, “2_sided”, “2-sides”, “two_sides”, “two-sides”, “2_sides”, “ts”, “t”, “two”, “2”, 2),

    • ”left-sided” (aliases “left_sided”, “left”, “ls”, “l”),

    • ”right-sided” (aliases “right_sided”, “right”, “rs”, “r”),

    case insensitive.

Returns:

confint – The confidence interval.

Return type:

ConfidenceInterval