bundles / scipy latest / scipy / stats / _odds_ratio / OddsRatioResult / confidence_interval
function
scipy.stats._odds_ratio:OddsRatioResult.confidence_interval
source: /scipy/stats/_odds_ratio.py :209
Signature
def confidence_interval ( self , confidence_level = 0.95 , alternative = two-sided ) Summary
Confidence interval for the odds ratio.
Parameters
confidence_level: floatDesired confidence level for the confidence interval. The value must be given as a fraction between 0 and 1. Default is 0.95 (meaning 95%).
alternative: {'two-sided', 'less', 'greater'}, optionalThe alternative hypothesis of the hypothesis test to which the confidence interval corresponds. That is, suppose the null hypothesis is that the true odds ratio equals
ORand the confidence interval is(low, high). Then the following options foralternativeare available (default is 'two-sided'):'two-sided': the true odds ratio is not equal to
OR. There is evidence against the null hypothesis at the chosenconfidence_levelifhigh < ORorlow > OR.'less': the true odds ratio is less than
OR. Thelowend of the confidence interval is 0, and there is evidence against the null hypothesis at the chosenconfidence_levelifhigh < OR.'greater': the true odds ratio is greater than
OR. Thehighend of the confidence interval isnp.inf, and there is evidence against the null hypothesis at the chosenconfidence_leveliflow > OR.
Returns
ci: ``ConfidenceInterval`` instanceThe confidence interval, represented as an object with attributes
lowandhigh.
Notes
When kind is 'conditional', the limits of the confidence interval are the conditional "exact confidence limits" as described by Fisher [1]. The conditional odds ratio and confidence interval are also discussed in Section 4.1.2 of the text by Sahai and Khurshid [2].
When kind is 'sample', the confidence interval is computed under the assumption that the logarithm of the odds ratio is normally distributed with standard error given by
se = sqrt(1/a + 1/b + 1/c + 1/d)where a, b, c and d are the elements of the contingency table. (See, for example, [2], section 3.1.3.2, or [3], section 2.3.3).
Aliases
-
scipy.stats._odds_ratio.OddsRatioResult.confidence_interval