lgOR.vcov {metavcov}R Documentation

Computing Variance-Covariance Matrices for Log Odds Ratios

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 log odds ratio. See mix.vcov for effect sizes of the same or different types.

Usage

lgOR.vcov(r, nt, nc, st, sc, n_rt = NA, n_rc = NA)

Arguments

r

A NN-dimensional list of p×pp \times p correlation matrices for the pp outcomes from the NN studies. r[[k]][i,j] is the correlation coefficient between outcome ii and outcome jj from study kk.

nt

A N×pN \times p matrix storing sample sizes in the treatment group reporting the pp outcomes. nt[i,j] is the sample size from study ii reporting outcome jj.

nc

A matrix defined in a similar way as nt for the control group.

st

A N×pN \times p matrix recording number of participants with event for all outcomes (dichotomous) in treatment group. st[i,j] reports number of participants with event for outcome jj in treatment group for study ii. If outcome jj is not dichotomous, NA has to be imputed in column jj.

sc

Defined in a similar way as st for the control group.

n_rt

A NN-dimensional list of p×pp \times p matrices storing sample sizes in the treatment group reporting pairwise outcomes in the off-diagonal elements. n_rt[[k]][i,j] is the sample size reporting both outcome ii and outcome jj from study kk. Diagonal elements of these matrices are discarded. The default value is NA, which means that the smaller sample size reporting the corresponding two outcomes is imputed: i.e. n_rt[[k]][i,j]=min(nt[k,i],nt[k,j]).

n_rc

A list defined in a similar way as n_rt for the control group.

Value

ef

A N×pN \times p data frame whose columns are computed log odds ratios.

list.vcov

A NN-dimensional list of p(p+1)/2×p(p+1)/2p(p+1)/2 \times p(p+1)/2 matrices of computed variance-covariance matrices.

matrix.vcov

A N×p(p+1)/2N \times p(p+1)/2 matrix whose rows are computed variance-covariance vectors.

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 log odds ratios and 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 <- lgOR.vcov(nt = subset(Geeganage2010, select = c(nt_DD, nt_D)),
                     nc = subset(Geeganage2010, select = c(nc_DD, nc_D)),
                     st = subset(Geeganage2010, select = c(st_DD, st_D)),
                     sc = subset(Geeganage2010, select = c(sc_DD, sc_D)),
                     r = r.Gee)
# name computed log odds ratio as y
y <- computvcov$ef
colnames(y) <- c("lgOR.DD", "lgOR.D")
# name variance-covariance matrix of trnasformed z scores as S
S <- computvcov$matrix.vcov
## fixed-effect model
MMA_FE <- summary(metafixed(y = y, Slist = computvcov$list.vcov))
MMA_FE
#######################################################################
# 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(lgOR.DD, lgOR.D)~1,
#                            S = S,
#                            data = as.data.frame(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 = c("lgOR.DD", "lgOR.D"),
        name.study = Geeganage2010$studyID,
        y.all = obj$coefficients[,1],
        y.all.se = obj$coefficients[,2],
        hline = 1)
# dev.off()

[Package metavcov version 2.1.5 Index]