: [pval, chisq, df] = mcnemar_test (x)

For a square contingency table x of data cross-classified on the row and column variables, McNemar’s test can be used for testing the null hypothesis of symmetry of the classification probabilities.

Under the null, chisq is approximately distributed as chisquare with df degrees of freedom.

The p-value (1 minus the CDF of this distribution at chisq) is returned in pval.

If no output argument is given, the p-value of the test is displayed.

Package: statistics