[R] Mantel Haenszel test

tgs77m m@iii@g oii y@hoo@com tgs77m m@iii@g oii y@hoo@com
Sat Sep 23 16:56:29 CEST 2023


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 column variables.

Can anyone give me an example of the code which calculates the squared
Pearson correlation
between row and column variables? 

I am at a loss on how to do this.

All the best,

Thomas Subia



More information about the R-help mailing list