mcnemar_test
Test whether two paired proportions are equal (e.g., before/after intervention or two raters on same items) and get chi-squared, p-value, and confidence interval for the difference.
Instructions
Test whether two paired proportions are equal -- e.g. the same subjects' yes/no answers before and after an intervention, or two raters' calls on the same items. Use this instead of two_proportion_z_test whenever the "two groups" are actually the same subjects measured twice; two_proportion_z_test assumes independent groups and gets the standard error wrong for paired data. Yates continuity-corrected chi-squared, 1 df -- use mcnemar_exact_test instead when there are few discordant pairs (this warns when there are). Returns that chi-squared statistic, a p-value, and a confidence interval for the difference in marginal proportions.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| alpha | No | significance level for the test (and any confidence interval); default 0.05 | |
| table | Yes | 2x2 table as [[a, b], [c, d]]: a/d are pairs that agree both times, b/c are the discordant pairs (b: positive then negative, c: negative then positive) -- raw non-negative integer counts |