############################################################## # # # V A L I D I T Y S T U D I E S # # # # GENERIC INVERSE VARIANCE METHOD # # # # R packages: meta and metafor # # # ############################################################## ## ## DATA ## ## r = sample correlation coefficient ## n = sample size # r <- c(0.68, 0.56, 0.23, 0.64, 0.49, -0.04, 0.49, 0.33, 0.58, 0.18, -0.11, 0.27, 0.26, 0.40, 0.49, 0.51, 0.40, 0.34, 0.42, 0.16) n <- c( 10, 20, 13, 22, 28, 12, 12, 36, 19, 12, 36, 75, 33, 121, 37, 14, 40, 16, 14, 20) ## ## standard error std.r <- sqrt( (1 - r**2)**2 / (n-1) ) ## ## Use of R package meta library(meta) ## ## metagen function requests: effect size and standard error validity <- metagen(r,std.r) print(validity) ## ## Confidence interval plot plot(validity, comb.fixed=TRUE, xlab="Correlation coefficient", main="Validity Studies") ## ## Forest plot grid.newpage() forest(validity, comb.fixed=TRUE, xlab="Correlation coefficient") ## ## ## ## Use of R package metafor library(metafor) ## ## rma.uni function request: effect size and standard error (or sampling variance) ## Use of standard error sei= ## Fixed effects approach validity.2 <- rma.uni(yi=r, sei=std.r, method="FE") print(validity.2) ## ## Four plots: forest plot, funnel plot, radial plot, plot of standardized residuals plot(validity.2) ## ## Random effects approach ## DerSimonian-Laird estimate validity.3 <- rma.uni(yi=r, sei=std.r, method="DL") print(validity.3) plot(validity.3)