Table2x2.homogeneity()

statsmodels.stats.contingency_tables.Table2x2.homogeneity

Table2x2.homogeneity(method='stuart_maxwell')

Compare row and column marginal distributions.

Parameters:

method : string

Either ‘stuart_maxwell’ or ‘bhapkar’, leading to two different estimates of the covariance matrix for the estimated difference between the row margins and the column margins.

Returns a bunch with attributes:

statistic : float

The chi^2 test statistic

pvalue : float

The p-value of the test statistic

df : integer

The degrees of freedom of the reference distribution

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).

© 2009–2012 Statsmodels Developers
© 2006–2008 Scipy Developers
© 2006 Jonathan E. Taylor
Licensed under the 3-clause BSD License.
http://www.statsmodels.org/stable/generated/statsmodels.stats.contingency_tables.Table2x2.homogeneity.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部