asyCov {metaSEM} | R Documentation |
Compute Asymptotic Covariance Matrix of a Correlation/Covariance Matrix
Description
It computes the asymptotic sampling covariance matrix of a correlation/covariance matrix under the assumption of multivariate normality.
Usage
asyCov(x, n, cor.analysis = TRUE, as.matrix = TRUE,
acov=c("weighted", "individual", "unweighted"), ...)
asyCovOld(x, n, cor.analysis = TRUE, dropNA = FALSE, as.matrix = TRUE,
acov=c("individual", "unweighted", "weighted"),
suppressWarnings = TRUE, silent = TRUE, run = TRUE, ...)
Arguments
x |
A correlation/covariance matrix or a list of
correlation/covariance matrices. |
n |
Sample size or a vector of sample sizes |
cor.analysis |
Logical. The output is either a correlation or covariance matrix. |
dropNA |
Logical. If it is |
as.matrix |
Logical. If it is |
acov |
If it is |
suppressWarnings |
Logical. If |
silent |
Logical. An argument to be passed to |
run |
Logical. If |
... |
It is ignored in |
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.
Note
Before 1.2.6, asyCov
used an SEM approach based on Cheung
and Chan (2004). After 1.2.6, asyCov
was rewritten based on
Olkin and Siotani (1976) for correlation matrix and Yuan and Bentler
(2007, p. 371) for covariance matrix. Arguments such as dropNA
,
suppressWarnings
, silent
, and run
were
dropped. The original version was renamed to asyCovOld
for
compatibility.
Author(s)
Mike W.-L. Cheung <mikewlcheung@nus.edu.sg>
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
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)