This is a pre-release version (2.0.0.dev0+git20260907.41eeb59).Go to latest (1.18.0)
{ } Raw JSON

bundles / scipy 2.0.0.dev0+git20260907.41eeb59 / scipy / stats / _binomtest / BinomTestResult / proportion_ci

function

scipy.stats._binomtest:BinomTestResult.proportion_ci

source: build-install/usr/lib/python3.14/site-packages/scipy/stats/_binomtest.py:52

Signature

def proportion_ci(self, confidence_level = 0.95, method = exact)

Summary

Compute the confidence interval for statistic.

Parameters

confidence_level : float, optional

Confidence level for the computed confidence interval of the estimated proportion. Default is 0.95.

method : {'exact', 'wilson', 'wilsoncc'}, optional

Selects the method used to compute the confidence interval for the estimate of the proportion:

'exact' :

Use the Clopper-Pearson exact method [1].

'wilson' :

Wilson's method, without continuity correction ([2], [3]).

'wilsoncc' :

Wilson's method, with continuity correction ([2], [3]).

Default is 'exact'.

Returns

ci : ``ConfidenceInterval`` object

The object has attributes low and high that hold the lower and upper bounds of the confidence interval.

Examples

from scipy.stats import binomtest
result = binomtest(k=7, n=50, p=0.1)
✓
result.statistic
result.proportion_ci()
✗
ConfidenceInterval(low=np.float64(0.058191700340372084), high=np.float64(0.2673960024970084))

Aliases

  • scipy.stats._binomtest.BinomTestResult.proportion_ci