statsmodels.stats.contingency_tables.StratifiedTable.test_equal_odds#

StratifiedTable.test_equal_odds(adjust=False)[source]#

Test that all odds ratios are identical

This is the ‘Breslow-Day’ testing procedure.

Parameters:
adjustbool, optional

Use the ‘Tarone’ adjustment to achieve the chi^2 asymptotic distribution.

Returns:
Bunch

A bunch with attributes

  • statisticfloat

    The chi^2 test statistic.

  • pvaluefloat

    The p-value for the test.

Notes

The statistic is computed from the fitted cell counts of each stratum given the pooled (Mantel-Haenszel) odds ratio.

If a stratum has a row or column total of zero, the statistic and the p-value are NaN.

Changed in version 0.15.1: The test can be computed if the pooled odds ratio is exactly 1, where it was NaN before. The fitted counts are computed in a way that avoids a loss of precision if the pooled odds ratio is close to 1 or some fitted counts are small. Results can differ from those of earlier versions by a relative amount of about 1e-12, and by more for tables where the earlier calculation lost precision.