### copy data into 'dat' and examine data
dat <- dat.aloe2013
dat
if (FALSE) {
### load metafor package
suppressPackageStartupMessages(library(metafor))
### compute the partial correlation coefficients and corresponding sampling variances
dat <- escalc(measure="PCOR", ti=tval, ni=n, mi=preds, data=dat)
dat
### random-effects model
res <- rma(yi, vi, data=dat)
res
### mixed-effects meta-regression model examining the relationship between the partial
### correlation coefficients and the number of predictors included in the models
res <- rma(yi, vi, mods = ~ preds, data=dat)
res
### compute the r-to-z transformed partial correlation coefficients and their variances
dat <- escalc(measure="ZPCOR", ti=tval, ni=n, mi=preds, data=dat)
dat
### random-effects model
res <- rma(yi, vi, data=dat)
res
### back-transformation to the partial correlation scale
predict(res, transf=transf.ztor)
### compute the semi-partial correlation coefficients and their variances
dat <- escalc(measure="SPCOR", ti=tval, ni=n, mi=preds, r2i=R2, data=dat)
dat
### random-effects model
res <- rma(yi, vi, data=dat)
res
}
Run the code above in your browser using DataLab