statsmodels.stats.contingency_tables.Table2x2.homogeneity¶
-
Table2x2.homogeneity(method=
'stuart_maxwell')¶ Compare row and column marginal distributions.
- Parameters:¶
- Returns:¶
A bunch with attributes:
- statisticfloat
The chi^2 test statistic
- pvaluefloat
The p-value of the test statistic
- dfint
The degrees of freedom of the reference distribution
- Return type:¶
Bunch
Notes
For a 2x2 table this is equivalent to McNemar’s test. More generally the procedure tests the null hypothesis that the marginal distribution of the row factor is equal to the marginal distribution of the column factor. For this to be meaningful, the two factors must have the same sample space (i.e. the same categories).