Logo

statsmodels.sandbox.stats.runs.mcnemar

statsmodels.sandbox.stats.runs.mcnemar(x, y, exact='auto', correction=True)[source]

McNemar test

Parameters:

x, y : array_like

two paired data samples

exact : bool or ‘auto’

correction : bool

If true then a continuity corection is used for the approximate chisquare distribution.

Returns:

stat : float or int

The test statistic is the chisquare statistic in the case of large samples or if exact is false. If the exact binomial distribution is used, then this contains the min(n1, n2), where n1, n2 are cases that are zero in one sample but one in the other sample.

pvalue : float

p-value of the null hypothesis of equal effects.

Notes

This is a special case of Cochran’s Q test. The results when the chisquare distribution is used are identical, except for the continuity correction.

Previous topic

statsmodels.stats.diagnostic.lillifors

Next topic

statsmodels.sandbox.stats.runs.median_test_ksample

This Page