r.vcov: Computing Variance-Covariance Matrices for Correlation...

Description Usage Arguments Details Value Author(s) References Examples

View source: R/r.vcov.R

Description

The function r.vcov computes variance-covariance matrix for multivariate meta-analysis when the effect size is measured by correlation coefficient.

Usage

1
r.vcov(n, corflat, zscore = FALSE, name = NULL, method = "average", na.impute = NA)

Arguments

n

A N-dimensional vector containing sample sizes from N studies.

corflat

A N x p matrix or data frame storing p correlation coefficients from each of the N studies.

zscore

Whether the correlation coefficients in corflat are already transformed into Fisher's z scores.

name

A p-dimensional vector containing names for the p correlation coefficients.

method

Method "average" computes variance and covariances with mean correlation coefficients that are sample-size weighted from all the N studies (missing values are omitted); method "each" computes variance and covariances with each of the corresponding correlation coefficients.

na.impute

Missing values can be imputed by a numeric value, such as zero by setting na.impute = 0. With the default setting na.impute = NA, missing values are not imputed. If specifying na.impute = "average", missing values are imputed by mean correlation coefficients that are sample-size weighted from the complete records.

Details

How to arrange correlation coefficients of each study from matrix to vector is in Cooper et al book page 385 to 386. Details for average method are in book of Cooper et al page 388. Let r_{ist} denote the sample correlation coefficient that describes the relationship between variables s and t in study i. We can calculate its variance as var({{r}_{ist}})={{(1-ρ_{ist}^{2})}^{2}}/{{n}_{i}}, and the covariance between two correlation coefficients is cov({{r}_{ist}},{{r}_{iuv}})=[.5{{ρ }_{ist}}{{ρ }_{iuv}}({{ρ }}_{isu}^{2}+{{ρ }}_{isv}^{2}+{{ρ }}_{itu}^{2}+{{ρ }}_{itv}^{2})+{{ρ }_{isu}}{{ρ }_{itv}}+{{ρ }_{isv}}{{ρ }_{itu}} \nonumber \\ -({{ρ }_{ist}}{{ρ }_{isu}}{{ρ }_{isv}}+{{ρ }_{its}}{{ρ }_{itu}}{{ρ }_{itv}}+{{ρ }_{ius}}{{ρ }_{iut}}{{ρ }_{iuv}}+{{ρ }_{ivs}}{{ρ }_{ivt}}{{ρ }_{ivu}})]/{{n}_{i}}, where ρ_{i..} represents the population value. In practice, ρ_{i..} can be substituted by the observed sample correlation or sample-size weighted mean correlation coefficients from all studies.

Value

r

A N x p data frame that contains the input argument corflat with column names and imputed values according to the input argument na.impute. If the input argument zscore=TRUE, r is transformed from Fisher's z score in corflat.

list.rvcov

A N-dimensional list of p(p+1)/2 x p(p+1)/2 matrices of computed variance-covariance matrices.

matrix.rvcov

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

ef

A N x p data frame that contains Fisher's z transformed correlation coefficients from the input argument corflat with column names and imputed values according to the input argument na.impute.

list.vcov

A list in the same format of list.rvcov for Fisher's z transformed correlation coefficients.

matrix.vcov

A matrix matrix.rvcov for Fisher's z transformed correlation coefficients.

Author(s)

Min Lu

References

Ahn, S., Lu, M., Lefevor, G.T., Fedewa, A. & Celimli, S. (2016). Application of meta-analysis in sport and exercise science. In N. Ntoumanis, & N. Myers (Eds.), An Introduction to Intermediate and Advanced Statistical Analyses for Sport and Exercise Scientists (pp.233-253). Hoboken, NJ: John Wiley and Sons, Ltd.

Cooper, H., Hedges, L.V., & Valentine, J.C. (Eds.) (2009). The handbook of research synthesis and meta-analysis. New York: Russell Sage Foundation.

Olkin, I., & Ishii, G. (1976). Asymptotic distribution of functions of a correlation matrix. In S. Ikeda (Ed.), Essays in probability and statistics: A volume in honor of Professor Junjiro Ogawa (pp.5-51). Tokyo, Japan: Shinko Tsusho.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
##############################################################
# A simple example:
# Checking the example in Harris Cooper et al.'s book page 388
##############################################################
r <- matrix(c(-0.074, -0.127, 0.324, 0.523, -0.416, -0.414), 1)
n <- 142
computvcov <- r.vcov(n = n, corflat = r,
                     name = paste("C", c("st", "su", "sv", "tu", "tv", "uv"), sep = ""),
                     method = "each")
round(computvcov$list.rvcov[[1]], 4)
round(computvcov$ef, 4)
round(computvcov$list.vcov[[1]], 4)
round(computvcov$matrix.vcov, 4)
######################################################
# Example: Craft2003 data
# Preparing covariances for multivariate meta-analysis
######################################################
data(Craft2003)
# extract correlation from the dataset (craft)
corflat <- subset(Craft2003, select=C1:C6)
# transform correlations to z and compute variance-covariance matrix.
computvcov <- r.vcov(n = Craft2003$N, corflat = corflat, method = "average")
# name transformed z scores as y
y <- computvcov$ef
# name variance-covariance matrix of trnasformed z scores as S
S <- computvcov$matrix.vcov
S[1, ]
## fixed-effect model
MMA_FE <- summary(metafixed(y = y, Slist = computvcov$list.vcov))
#######################################################################
# Running random-effects model using package "mvmeta" or "metaSEM"
#######################################################################
# Restricted maximum likelihood (REML) estimator from the mvmeta package
#library(mvmeta)
#mvmeta_RE <- summary(mvmeta(cbind(C1, C2, C3, C4, C5, C6),
#                           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 = Craft2003$ID,
        y.all = obj$coefficients[,1],
        y.all.se = obj$coefficients[,2])
# dev.off()

metavcov documentation built on Oct. 25, 2021, 9:08 a.m.