scipy.stats._result_classes.OddsRatioResult.

confidence_interval#

OddsRatioResult.confidence_interval(confidence_level=0.95, alternative='two-sided')[source]#

勝算比的信賴區間。

參數:
confidence_level: float

信賴區間的期望信賴水準。值必須以 0 到 1 之間的分數形式給定。預設值為 0.95(表示 95%)。

alternative{‘two-sided’, ‘less’, ‘greater’}, 選項性

與信賴區間對應的假設檢定的對立假設。也就是說,假設虛無假設為真實勝算比等於 OR,且信賴區間為 (low, high)。則以下是 alternative 的可用選項(預設為 ‘two-sided’)

  • ‘two-sided’:真實勝算比不等於 OR。如果 high < ORlow > OR,則在選擇的 confidence_level 下,有證據反對虛無假設。

  • ‘less’:真實勝算比小於 OR。信賴區間的 low 端點為 0,如果 high < OR,則在選擇的 confidence_level 下,有證據反對虛無假設。

  • ‘greater’:真實勝算比大於 OR。信賴區間的 high 端點為 np.inf,如果 low > OR,則在選擇的 confidence_level 下,有證據反對虛無假設。

回傳值:
ciConfidenceInterval 實例

信賴區間,表示為具有屬性 lowhigh 的物件。

註解

kind'conditional' 時,信賴區間的界限是 Fisher [1] 所描述的條件「精確信賴界限」。Sahai 和 Khurshid [2] 的文本第 4.1.2 節也討論了條件勝算比和信賴區間。

kind'sample' 時,信賴區間的計算基於勝算比的對數呈常態分佈的假設,其標準誤由下式給出

se = sqrt(1/a + 1/b + 1/c + 1/d)

其中 abcd 是列聯表的元素。(例如,請參閱 [2],第 3.1.3.2 節,或 [3],第 2.3.3 節)。

參考文獻

[1]

R. A. Fisher (1935), The logic of inductive inference, Journal of the Royal Statistical Society, Vol. 98, No. 1, pp. 39-82.

[2] (1,2)

H. Sahai and A. Khurshid (1996), Statistics in Epidemiology: Methods, Techniques, and Applications, CRC Press LLC, Boca Raton, Florida.

[3]

Alan Agresti, An Introduction to Categorical Data Analysis (second edition), Wiley, Hoboken, NJ, USA (2007).