Thursday, 9 February 2017

Bonett's (2008) Method for Confidence Intervals on Meta-Analysed Pearson's rs: Play Along in R


Yes. It's another blog about correlation coefficients. I make no apology for that. I estimate that - much like the old English adage about rats - you're never more than six feet away from a Pearson's r in personality and social psychology.


The topic at hand: confidence intervals on meta-analysed Pearson's rs. To recap, in my last blog I created an R script that would allow you to play along with Sarah's Pearson's r mini-meta analysis in the Goh, Hall, & Rosenthal (2016) paper on mini meta-analysis. After I had written that blog, I got talking to Jin on twitter about confidence intervals around meta-analysed rs.

I did some digging and it turns out that there's at least 5 different methods in the literature. I know this thanks to a great paper by Professor Doug Bonnet, in which 5 methods are pitted against each other with a simulation study. It's s a kind of meta-analytic royal rumble. Which are my words, not Professor Bonnet's - I doubt that framing would have gone down well at the journal. Here's that paper, courtesy of Professor Bonnet's Researchgate.

The contenders were HO-F, SH-F, HV-R, HS-R:



And a new method proposed by Bonnet, a mysterious newcomer simply known as equation 4.

Where p hat, the unweighted average of the sample correlations, is:


Where the approximate variance of p hat is:
And where variance of tanh^-1(p hat):



To cut a story longer than is appropriate for a blog short (but read it in your own time), equation 4 comes out on top. Empirically, in terms of its performance in the simulations carried out in the paper and, logically, because it does not require a couple of unrealistic assumptions that underpin alternative methods (see page 178).

Now, I fully understand that this equation will look a little alien to some. But I have scripted it in R, so that you can play along with the computational example given on page 177. As per usual, this script can be extremely easily modified to use with your own data to create confidence intervals for your own meta-analysed rs. The script is a bit flabby I expect. People that have been coding in R longer than me will almost definitely spot some redundancy, but it get's you the desired result. Click here, or scroll to the bottom of this blog post.

All you have to do is:

  • Enter your correlations in the cors <- c(.......) part.
  • Enter the n for each correlation in the ns <- c(.......) part.
  • Enter the number of correlations in the m <- x part.




Here's the code (thanks to Daniel Lakens for suggesting I use gist, here's his blog):


No comments:

Post a Comment