Skip to content
Prev 106603 / 398525 Next

McNemar test in R & SPSS

Bob Green wrote:
You still need the right table.

matrix(c(128,29,331,430), ncol =2,....)

consists of the two marginal tables, which has strictly less information than the crosstabulation of pre and post values. I expect every text on the McNemar test makes this point, and I'd be highly surprised if E&H really suggested that you should use the table that you did.
You need to give it the data when it starts with the "0:"-style prompt, 
end with a blank line, as shown. It's just a device for cutting and 
pasting your table. I might as well have used

d <- matrix(c(311,119,20,9), ncol=2)

Or, with the raw data to hand

d <- table(preMHT, postMHT)