### copy data into 'dat' and examine data
dat <- dat.mcdaniel1994
head(dat)
if (FALSE) {
### load metafor package
library(metafor)
### calculate r-to-z transformed correlations and corresponding sampling variances
dat <- escalc(measure="ZCOR", ri=ri, ni=ni, data=dat)
head(dat)
### meta-analysis of the transformed correlations using a random-effects model
res <- rma(yi, vi, data=dat)
res
### average correlation with 95% CI
predict(res, transf=transf.ztor, digits=2)
### mixed-effects model with interview type as factor
### note: job-related interviews is the reference level
res <- rma(yi, vi, mods = ~ factor(type), data=dat)
res
### estimated average correlation for each level of interview type
res <- rma(yi, vi, mods = ~ 0 + factor(type), data=dat)
predict(res, newmods=diag(3), transf=transf.ztor, digits=2)
### mixed-effects model with interview structure as factor
### note: structured interviews is the reference level
res <- rma(yi, vi, mods = ~ factor(struct), data=dat)
res
### estimated average correlation for each level of interview structure
res <- rma(yi, vi, mods = ~ 0 + factor(struct), data=dat)
predict(res, newmods=diag(2), transf=transf.ztor, digits=2)
### note: the interpretation of the results is difficult since all
### situational interviews were structured, almost all psychological
### interviews were unstructured, and actually for the majority of
### the psychological interviews it was unknown whether the interview
### was structured or unstructured
table(dat$type, dat$struct, useNA="always")
### meta-analysis of raw correlations using a random-effects model
res <- rma(measure="COR", ri=ri, ni=ni, data=dat.mcdaniel1994)
res
}
Run the code above in your browser using DataLab