[R] Using McNemar's test to detect shifts in response from pre- topost-treatment

Robert Baer rbaer at atsu.edu
Tue Sep 14 20:58:20 CEST 2010


McNemar is good for paired data. See
?mcnemar.test

You need to get your data into the form of a matrix (e.g., help example), 
and you will need data organized by concordant and discordant pairing.

This means that you will need to organize your data differently than you 
show us:
# pairs YES YES pre-post
# pairs YES NO pre-post
# pairs NO-YES pre-post
# pairs NO-NO pre-post0

Finally, you will need to decide whether to apply the usual continuity 
correction with your sample size (TRUE by default).

Rob
----- Original Message ----- 
From: "Paul Miller" <pjmiller_57 at yahoo.com>
To: <r-help at r-project.org>
Sent: Tuesday, September 14, 2010 11:46 AM
Subject: [R] Using McNemar's test to detect shifts in response from pre- 
topost-treatment


Hello Everyone,

I've been asked to check if there is a significant difference in the 
following:

Pre Post
Group A 15/19 14/19
Group B 14/19 10/19

My sense is that I need to perform McNemar's test on these data because 
responses are correlated within patient from the pre-test to the post-test.

The question is how to do this. I'm a SAS user who is learning R. I'm not 
sure how to do this in SAS and am even less certain about how to do it in R. 
The R books I have don't seem to cover this. At this point, I'm not even 
sure if the information I've been given is what I needed to perform the 
test.

If anyone can help with this, it would be greatly appreciated.

Thanks,

Paul


[[alternative HTML version deleted]]




--------------------------------------------------------------------------------


> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide 
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list