smd.vcov {metavcov} | R Documentation |
Computing Variance-Covariance Matrices for Standardized Mean Differences
Description
The function lgOR.vcov
computes effect sizes and variance-covariance matrix for multivariate meta-analysis when the effect sizes of interest are all measured by standardized mean difference. See mix.vcov
for effect sizes of the same or different types.
Usage
smd.vcov(nt, nc, d, r, n_rt = NA, n_rc = NA, name = NULL)
Arguments
nt |
A |
nc |
A matrix defined in a similar way as |
d |
A |
r |
A |
n_rt |
A |
n_rc |
A list defined in a similar way as |
name |
Names for the outcomes. |
Value
ef |
A |
list.vcov |
A |
matrix.vcov |
A |
list.dvcov |
A |
matrix.dvcov |
A |
Author(s)
Min Lu
References
Lu, M. (2023). Computing within-study covariances, data visualization, and missing data solutions for multivariate meta-analysis with metavcov. Frontiers in Psychology, 14:1185012.
Examples
######################################################
# Example: Geeganage2010 data
# Preparing covarianceS for multivariate meta-analysis
######################################################
data(Geeganage2010)
## set the correlation coefficients list r
r12 <- 0.71
r.Gee <- lapply(1:nrow(Geeganage2010), function(i){matrix(c(1, r12, r12, 1), 2, 2)})
computvcov <- smd.vcov(nt = subset(Geeganage2010, select = c(nt_SBP, nt_DBP)),
nc = subset(Geeganage2010, select = c(nc_SBP, nc_DBP)),
d = subset(Geeganage2010, select = c(SMD_SBP, SMD_DBP)), r = r.Gee,
name = c("SMD_SBP", "SMD_DBP"))
# name variance-covariance matrix as S
S <- computvcov$matrix.vcov
## fixed-effect model
y <- computvcov$ef
MMA_FE <- summary(metafixed(y = y, Slist = computvcov$list.vcov))
#######################################################################
# Running random-effects model using package "mixmeta" or "metaSEM"
#######################################################################
# Restricted maximum likelihood (REML) estimator from the mixmeta package
#library(mixmeta)
#mvmeta_RE <- summary(mixmeta(cbind(SMD_SBP, SMD_DBP)~1,
# S = S,
# data = y,
# method = "reml"))
#mvmeta_RE
# maximum likelihood estimators from the metaSEM package
# library(metaSEM)
# metaSEM_RE <- summary(meta(y = y, v = S))
# metaSEM_RE
##############################################################
# Plotting the result:
##############################################################
obj <- MMA_FE
# obj <- mvmeta_RE
# obj <- metaSEM_RE
# pdf("CI.pdf", width = 4, height = 7)
plotCI(y = computvcov$ef, v = computvcov$list.vcov,
name.y = NULL, name.study = Geeganage2010$studyID,
y.all = obj$coefficients[,1],
y.all.se = obj$coefficients[,2])
# dev.off()