Why is there such a difference between chi2 and mcnemar?

12 views Asked by At

With R, I run these two tests and get very different results. Does anyone have any explanations? Thanks in advance!

Here is the code:

response_distribution <- matrix(c(1298, 818,    # Number of "No" and "YES" in condition "High" 
                                  4176, 2682),  # Number of "No" and "YES" in condition "Low"
                                nrow = 2,       # Number of conditions
                                byrow = TRUE,   # Fill matrix by rows
                                dimnames = list(c("High", "Low"), c("0", "1")))

chisq.test(response_distribution)
mcnemar.test(response_distribution)

Here is the result:

> chisq.test(response_distribution)

    Pearson's Chi-squared test with Yates' continuity correction

data:  response_distribution
X-squared = 0.11924, df = 1, p-value = 0.7299

> mcnemar.test(response_distribution)

    McNemar's Chi-squared test with continuity correction

data:  response_distribution
McNemar's chi-squared = 2256.6, df = 1, p-value < 2.2e-16

I wanted to do a mcnemar (because the subjects are matched) but the result is so different from chi2 that I have my doubts.

0

There are 0 answers