# Compare two proportions from same sample (mutually non exclusive)

I want to know what test to use to compare 2 percentages from the same sample.

My study is as follows: I conducted a survey on 50 people regarding consent for 2 tests (X and Y). 48 people consented to test X, 40 people consented to test Y. So the consent rate for test X would be 48/50 (96%) and the consent rate for test Y would be 40/50 (80%).

How to compare these two percentages? Can I say the consent rate for test X is better than the consent rate for test Y? How to know if this is statistically significant? I tried Fisher's exact test and I tried to generate a contingency table, but I don’t know whether I can apply Fisher's exact test for non mutually exclusive data.

I guess you would be having the data on how many subjects consented to both tests. Draw a simple Venn diagram with the information you have. Find out how many are there who consented only for test X and only for test Y and those who consented to both. Now, that makes the categories mutually exclusive. Consider those who provide consent to both the tests as a separate category "agrees to both tests X and Y". This creates three categories and depending on the size of the cells, you can use Chi-square test or Fisher's exact. Try this. May help.

• I think the chi square test is only for two samples, no? Does it mean I should ignore the third group that consents to both? Thanks. Commented Aug 10, 2019 at 19:31

You can try the McNemar chi squared test and Z test for paired samples.

Quoted from the book, the type of situation typically involves measurements made on a variable before and after some sort of intervention.

$$\begin{bmatrix} e & f \\ g & h \end{bmatrix}$$
Here, $$e$$ people answer yes to both, $$h$$ people answer no to both, $$g$$ answer No to X but Yes to Y, and $$f$$ answer Yes to X but no to Y.
$$\dfrac{(f-g)^2}{f+g}$$