scipy.stats._result_classes.BinomTestResult.

proportion_ci#

BinomTestResult.proportion_ci(confidence_level=0.95, method='exact')[source]#

計算 statistic 的信賴區間。

參數:
confidence_levelfloat,選用

估計比例的計算信賴區間的信賴水準。預設值為 0.95。

method{‘exact’, ‘wilson’, ‘wilsoncc’},選用

選擇用於計算估計比例的信賴區間的方法

‘exact’

使用 Clopper-Pearson 精確方法 [1]

‘wilson’

Wilson 方法,不含連續性校正 ([2][3])。

‘wilsoncc’

Wilson 方法,含連續性校正 ([2][3])。

預設值為 'exact'

回傳值:
ciConfidenceInterval 物件

此物件具有屬性 lowhigh,用於保存信賴區間的下限和上限。

參考文獻

[1]

C. J. Clopper 和 E. S. Pearson,《The use of confidence or fiducial limits illustrated in the case of the binomial》,Biometrika,第 26 卷,第 4 期,第 404-413 頁 (1934 年 12 月)。

[2] (1,2)

E. B. Wilson,《Probable inference, the law of succession, and statistical inference》,J. Amer. Stat. Assoc.,22,第 209-212 頁 (1927)。

[3] (1,2)

Robert G. Newcombe,《Two-sided confidence intervals for the single proportion: comparison of seven methods》,Statistics in Medicine,17,第 857-872 頁 (1998)。

範例

>>> from scipy.stats import binomtest
>>> result = binomtest(k=7, n=50, p=0.1)
>>> result.statistic
0.14
>>> result.proportion_ci()
ConfidenceInterval(low=0.05819170033997342, high=0.26739600249700846)