statsmodels.sandbox.stats.runs.cochrans_q

statsmodels.sandbox.stats.runs.cochrans_q(x)[source]

Cochran’s Q test for identical effect of k treatments

Cochran’s Q is a k-sample extension of the McNemar test. If there are only two treatments, then Cochran’s Q test and McNemar test are equivalent.

Test that the probability of success is the same for each treatment. The alternative is that at least two treatments have a different probability of success.

Parameters
xarray_like, 2d (N,k)

data with N cases and k variables

Returns
q_statfloat

test statistic

pvaluefloat

pvalue from the chisquare distribution

Notes

In Wikipedia terminology, rows are blocks and columns are treatments. The number of rows N, should be large for the chisquare distribution to be a good approximation. The Null hypothesis of the test is that all treatments have the same effect.

References

https://en.wikipedia.org/wiki/Cochran_test SAS Manual for NPAR TESTS