Re: [R] Mantel Haenszel test

2023-09-23 Thread Jeff Newmiller via R-help
?cor cor( M, t( M ) ) On September 23, 2023 7:56:29 AM PDT, tgs77m--- via R-help wrote: >Colleagues, > >I am trying to write a script for the Mantel Haenszel test. > >For the MH test, the test statistic is chi-square (MH) = (W-1) * r^2 >Where W = sum of the case weights. This is straight

[R] Mantel Haenszel test

2023-09-23 Thread tgs77m--- via R-help
Colleagues, I am trying to write a script for the Mantel Haenszel test. For the MH test, the test statistic is chi-square (MH) = (W-1) * r^2 Where W = sum of the case weights. This is straight forward. I'm having difficulty with r^2. The r^2 is the squared Pearson correlation between row and