{ } Raw JSON

bundles / scipy 1.17.1 / scipy / stats / _binomtest / BinomTestResult / proportion_ci

function

scipy.stats._binomtest:BinomTestResult.proportion_ci

source: /scipy/stats/_binomtest.py :50

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()

Aliases

  • scipy.stats._binomtest.BinomTestResult.proportion_ci