Skip to content
Prev 2914 / 5632 Next

[R-meta] (no subject)

Dear Garance,

Please see my responses below.

Best,
Wolfgang
The equation you showed assumes that an *unweighted* average is taken of the two effect sizes. So if you computed a weighted mean, then this equation is not correct.
I assume you are talking about the aggregate() function and you are using something like:

aggregate(dat, cluster=dat$study, struct="CS", rho=<>)

The function by default computes weighted averages of the effects within studies (based on the variance-covariance matrix of the effects, which is constructed based on the sampling variances and the assumed value of rho). When rho changes, the var-cov matrix changes and hence the weighted averages change. You can also use weighted=FALSE in which case unweighted averages are computed and then rho does not affect these averages (although it still affects the variances of the computed averages).
I think so, but my opinion on this matter might be biased :) You can inspect the code of the function here: https://github.com/wviechtb/metafor/blob/master/R/aggregate.escalc.r If you find any mistakes/errors, please let me know!
Please provide a fully reproducible example. I had to guess what exactly you did with metafor, but it might have been this:

library(metafor)
dat <- data.frame(study=1, ni=c(337,219), ri=c(-.09,-.02))
dat <- escalc(measure="COR", ri=ri, ni=ni, data=dat)
aggregate(dat, cluster=dat$study, struct="CS", rho=0.555)

At least this yields yi=-0.0718.

aggregate(dat, cluster=dat$study, struct="CS", rho=0.555, weighted=FALSE)

gives an unweighted average of -0.0550 (following Borenstein). Not sure what you did but

weighted.mean(dat$ri, dat$ni)

gives -0.06242806 which is close to -0.06255 but not identical (and again this is not what Borenstein suggests).