Learn R Programming

metaSEM (version 2.0)

asyCovOld: Compute Asymptotic Covariance Matrix of a Correlation/Covariance Matrix

Description

Variable names and data column names must not contain periods. Rename them consistently, for example x.1 to x_1, and check that the new names are unique. Study, group, and cluster values may contain periods.

It computes the asymptotic sampling covariance matrix of a correlation/covariance matrix under the assumption of multivariate normality.

Usage

asyCovOld(
  x,
  n,
  cor.analysis = TRUE,
  dropNA = FALSE,
  as.matrix = TRUE,
  acov = c("individual", "unweighted", "weighted"),
  suppressWarnings = TRUE,
  silent = TRUE,
  run = TRUE,
  ...
)

asyCov( x, n, cor.analysis = TRUE, as.matrix = TRUE, acov = c("weighted", "individual", "unweighted"), ... )

Value

An asymptotic covariance matrix of the vectorized correlation/covariance matrix or a list of these matrices. If as.matrix=TRUE and x is a list of matrices, the output is a stacked matrix.

Arguments

x

A correlation/covariance matrix or a list of correlation/covariance matrices. Missing-value patterns must be symmetric, and observed entries must be finite. In asyCov(), missing input elements can propagate to sampling covariance entries. In covariance analysis, entries that can be determined from the available values are retained. A known zero times an unknown covariance is treated as zero. A missing statistic has a missing row and column in its sampling covariance matrix. For lists, acov="weighted" and acov="unweighted" use available-study averages as a common working matrix before calculating sampling covariances. A pair missing from every study remains unknown. The resulting missing sampling covariances may need an explicit approximation before fitting a meta-analysis. asyCovOld() identifies missing variables using the diagonal. A one-variable covariance matrix is supported; a one-variable correlation matrix has no correlations to analyze.

n

Positive finite sample size or vector of sample sizes. For a list of studies, lengths must match unless one input has length one; named study matrices of equal size are aligned by variable names.

cor.analysis

Logical. The output is either a correlation or covariance matrix.

dropNA

Logical. If it is TRUE, the resultant dimensions will be reduced by dropping the missing variables. If it is FALSE, the resultant dimensions are the same as the input by keeping the missing variables.

as.matrix

Logical. If it is TRUE and x is a list of correlation/covariance matrices with the same dimensions, the asymptotic covariance matrices will be column vectorized and stacked together. If it is FALSE, the output will be a list of asymptotic covariance matrices. Note that if it is TRUE, dropNA will be FALSE automatically. This option is useful when passing the asymptotic covariance matrices to meta

acov

If it is individual, the sampling variance-covariance matrices are calculated based on the individual correlation/covariance matrix. If it is either unweighted or weighted, the average correlation/covariance matrix is calculated based on the unweighted or weighted mean with the sample sizes. The average correlation/covariance matrix is used to calculate the sampling variance-covariance matrices. Fully specified non-positive-definite input or pooled working matrices are rejected. With missing entries, fully specified principal submatrices are checked using a bounded search. A warning is issued if the search limit is reached. Even a complete search does not guarantee that the partial matrix has a positive-definite completion.

suppressWarnings

Logical. If TRUE, warnings are suppressed. It is passed to mxRun.

silent

Logical. An argument to be passed to mxRun

run

Logical. If FALSE, only return the mx model without running the analysis.

...

It is ignored in asyCov. The additional arguments will be passed to mxRun in asyCovOld.

Author

Mike W.-L. Cheung <[email protected]>

References

Cheung, M. W.-L., & Chan, W. (2004). Testing dependent correlation coefficients via structural equation modeling. Organizational Research Methods, 7, 206-223.

Olkin, I., & Siotani, M. (1976). Asymptotic distribution of functions of a correlation matrix. In S. Ideka (Ed.), Essays in probability and statistics (pp. 235-251). Shinko Tsusho.

Yuan, K.-H., & Bentler, P. M. (2007). Robust procedures in structural equation modeling. In S.-Y. Lee (Ed.), Handbook of Latent Variable and Related Models (pp. 367-397). Elsevier/North-Holland.

Examples

Run this code

# \donttest{
C1 <- matrix(c(1,0.5,0.4,0.5,1,0.2,0.4,0.2,1), ncol=3)  
asyCov(C1, n=100)

## Data with missing values
C2 <- matrix(c(1,0.4,NA,0.4,1,NA,NA,NA,NA), ncol=3)  
C3 <- matrix(c(1,0.2,0.2,1), ncol=2)

## Output is a stacked matrix of asymptotic covariance matrices
asyCov(list(C1,C2), n=c(100,50), as.matrix=TRUE)

## Output is a stacked matrix of asymptotic covariance matrices
asyCov(list(C3,C3), n=c(100,50), as.matrix=TRUE)

## Output is a list of asymptotic covariance matrices using the old version
asyCovOld(list(C1,C2,C3), n=c(100,50,50), dropNA=TRUE, as.matrix=FALSE)
# }

Run the code above in your browser using DataLab