diff_binom_confint.compute_difference_confidence_interval#
- diff_binom_confint.compute_difference_confidence_interval(n_positive: int, n_total: int, ref_positive: int, ref_total: int, conf_level: float = 0.95, method: str = 'wilson', clip: bool = True, sides: str | int = 'two-sided') ConfidenceInterval [source]#
Compute the confidence interval of the difference between two binomial proportions.
- Parameters:
n_positive (int) – Number of positive samples.
n_total (int) – Total number of samples.
ref_positive (int) – Number of positive samples of the reference.
ref_total (int) – Total number of samples of the reference.
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
(-1, 1)
.sides (str or int, default "two-sided") –
the 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: