R: Conduct a Correlation/Covariance Structure Analysis with WLS
wls
R Documentation
Conduct a Correlation/Covariance Structure Analysis with WLS
Description
It fits a correlation or covariance structure with
weighted least squares (WLS) estimation method where the inverse of the asymptotic covariance matrix is
used as the weight matrix. tssem2 conducts the second stage
analysis of the two-stage strutural equation modeling (TSSEM). tssem2 is a wrapper of wls.
An object of either class
tssem1FEM, class tssem1FEM.cluster or class
tssem1REM returned from tssem1()
Cov
A p x p sample correlation/covariance matrix
where p is the number of variables.
asyCov
A p* x p* asymptotic sampling covariance
matrix of either vechs(Cov) or
vech(Cov) where p*
= p(p-1)/2 for correlation matrix and p* = p(p+1)/2 for covariance matrix.
n
Sample size.
Amatrix
An asymmetric matrix in the RAM approach with
MxMatrix-class. If it is NULL, a matrix
of zero will be created. If it is a matrix, it will be converted into MxMatrix-class by the as.mxMatrix function.
Smatrix
A symmetric matrix in the RAM approach with MxMatrix-class. If it is a matrix, it will be converted into MxMatrix-class by the as.mxMatrix function.
Fmatrix
A filter matrix in the RAM approach with
MxMatrix-class. If it is NULL (the default), an
identity matrix with the same dimensions of Cov will be
created. If it is a matrix, it will be converted into MxMatrix-class by the as.mxMatrix function. It is not required when there is no latent variable.
diag.constraints
Logical. This argument is ignored when
cor.analysis=FALSE. If
diag.constraints=TRUE, the diagonals of the model implied matrix will be constrained at 1 by nonlinear constraints. The drawback is that standard
error will not be generated. Parametric bootstrap is used to
estimate the standard error by drawing samples from N(vech(Cov), asyCov) for covariance analysis and N(vechs(Cov), asyCov) for
correlation analysis while asyCov is treated as fixed. This process
is computational intensive. A better approach is to request likelihood-based
confidence intervals (CIs) by specifying intervals.type="LB".
If diag.constraints=FALSE and cor.analysis=TRUE, the diagonals are automatically constrained as ones by
treating the error variances as computed values rather than as
parameters. Since the error variances are not parameters, they are not reported.
cor.analysis
Logical. Analysis of correlation or covariance structure. If cor.analysis=TRUE, vechs is used to vectorize S; otherwise, vech is used to vectorize S.
intervals.type
Either z (default if missing) or
LB. If it is z, it calculates the 95% Wald CIs based on the z statistic. If it is LB, it
calculates the 95% likelihood-based CIs on the
parameter estimates. Please note that the z values and their
associated p values are based on the z statistic. They are not
related to the likelihood-based CIs.
mx.algebras
A list of mxMatrix or mxAlgebra objects on the Amatrix,
Smatrix and Fmatrx. It can be used to define new functions
of parameters and their LBCIs. For example, if the regression
coefficients to calculate an indirect effect are stored in A[1,2] and
A[1,3], we may define
list(ind=mxAlgebra(Amatrix[1,2]*Amatrix[1,3], name="ind"))
See the examples in Becker92 and
Hunter83. It should be noted that Fmatrix,
Amatrix, Smatrix, Iden (a p x p identity matrix), sampleS (sample correlation
or covariance matrix), impliedS1, impliedS (model implied
correlation or covariance matrix), vecS, invAcov, obj, One, select
and constraint and Ematrix (computed error variances when
diag.constraints=FALSE) have been defined internally. You
should not create new matrices using these names.
model.name
A string for the model name in
mxModel. If it is missing, the default is
"TSSEM2 (or WLS) Analysis of Correlation Structure" for cor.analysis=TRUE and
"TSSEM2 (or WLS) Analysis of Covariance Structure" for cor.analysis=FALSE.
suppressWarnings
Logical. If TRUE, warnings are
suppressed. Argument to be passed to mxRun.
silent
Logical. Argument to be passed to mxRun
run
Logical. If FALSE, only return the mx model without running the analysis.
...
Futher arguments to be passed to mxRun.
Value
An object of class wls with a list of
call
The matched call
Cov
Input data of either a covariance or correlation matrix
asyCov
Asymptotic covariance matrix of the input data
noObservedStat
Number of observed statistics
n
Sample size
cor.analysis
logical
noConstraints
Number of constraints imposed on S
indepModelChisq
Chi-square statistic of the independent model
returned by .indepwlsChisq
indepModelDf
Degrees of freedom of the independent model returned
by .indepwlsChisq
mx.fit
A fitted object returned from
mxRun
Note
If the input is a list of tssem1.obj, it returns a list of
results for each cluster.
Author(s)
Mike W.-L. Cheung <mikewlcheung@nus.edu.sg>
References
Bentler, P.M., & Savalei, V. (2010). Analysis of correlation structures: current status and open problems. In Kolenikov, S., Thombs, L., & Steinley, D. (Eds.). Recent Methodological Developments in Social Science Statistics (pp. 1-36). Hoboken, NJ: Wiley.
Cheung, M. W.-L. (2010). Fixed-effects meta-analyses as multiple-group structural equation models. Structural Equation Modeling, 17, 481-509.
Cheung, M. W.-L. (2014). Fixed- and random-effects meta-analytic structural equation modeling: Examples and analyses in R. Behavior Research Methods, 46, 29-40.
Cheung, M. W.-L., & Chan, W. (2005). Meta-analytic structural equation modeling: A two-stage approach. Psychological Methods, 10, 40-64.
Cheung, M. W.-L., & Chan, W. (2009). A two-stage approach to synthesizing covariance matrices in meta-analytic structural equation modeling. Structural Equation Modeling, 16, 28-53.
Joreskog, K. G., Sorbom, D., Du Toit, S., & Du Toit,
M. (1999). LISREL 8: New Statistical Features. Chicago: Scientific Software International.
McArdle, J. J., & MacDonald, R. P. (1984). Some algebraic properties of the Reticular Action Model for moment structures. British Journal of Mathematical and Statistical Psychology, 37, 234-251.