?cor cor( M, t( M ) )
On September 23, 2023 7:56:29 AM PDT, tgs77m--- via R-help <r-help@r-project.org> 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 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 > >______________________________________________ >R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see >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. -- Sent from my phone. Please excuse my brevity. ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.