statsmodels.stats.contingency_tables.StratifiedTable.test_null_odds#
- StratifiedTable.test_null_odds(correction=False)[source]#
Test that all tables have odds ratio equal to 1
This is the ‘Mantel-Haenszel’ test.
- Parameters:
- correctionbool,
optional If True, use the continuity correction when calculating the test statistic. As in R’s
mantelhaen.test, the correction of 0.5 is applied only if|sum(a - E(a))| >= 0.5, where the sum is over the strata andE(a)is the expected count of the upper left cell under the null hypothesis. Otherwise the statistic is not corrected.Changed in version 0.15.1: The correction is no longer applied if
|sum(a - E(a))|is smaller than 0.5. Previouslymin(0.5, |sum(a - E(a))|)was subtracted, which changed the statistic and p-value in this case. If the variance is zero, the statistic and p-value are now nan instead of inf and 0 when the correction is used.
- correctionbool,
- Returns:
BunchA bunch containing the chi^2 test statistic and p-value.