Manel
Manel

Reputation: 13

Sensitivity of Mcnemar test

I want to see if there is more genes in affected group than in no affected group

I thought first that a Fisher exact test will be correct but since affected group and no affected group are related (paired) so it seems to me that a McNemar test is more correct?

When I try the test it returns to me a significant p value of 2.2-e16 even when the carrier of the gene are equal in both affected and no affected group which would say that there is enrichment of this gene in one of this two groups?

Instead when I try fisher test I have a p value of 1 that make sense to me since the number of gene is equal in both affected and no affected. But since its a paired data I can not use this test.

tt = with(data, table(Disease, Gene))
tt
                             Gene
       Disease        NoCarrier    Carrier
          NoAffected      2043       57
          Affected        2043       57
mcnemar.test(tt)

McNemar's Chi-squared test with continuity correction

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

Thanks

Upvotes: 0

Views: 270

Answers (1)

Hack-R
Hack-R

Reputation: 23200

In a McNemar test the null hypothesis is that the probabilities of being classified into cells [i,j] and [j,i] are the same.

So the p-value should be tiny, as it is. Consider the case where i = 1 and j = 2.

H0: The probability of ending up in row 1 column 2 where there are only 57 observations = the probability of ending up in row 2 column 1 where there are 2,043

We can definitely reject the null hypothesis!

For more information see ?mcnemar.test.

Upvotes: 2

Related Questions