findFactorTotalCov {simsem} | R Documentation |
Find factor total covariance from regression coefficient matrix, factor residual covariance
Description
Find factor total covariances from regression coefficient matrix, factor residual covariance matrix. The residual covaraince matrix might be derived from factor residual correlation, total variance, and error variance. This function can be applied for path analysis model as well.
Usage
findFactorTotalCov(beta, psi = NULL, corPsi = NULL, totalVarPsi = NULL,
errorVarPsi = NULL, gamma = NULL, covcov = NULL)
Arguments
beta |
Regression coefficient matrix among factors |
psi |
Factor or indicator residual covariances. This argument can be skipped if factor residual correlation and either total variances or error variances are specified. |
corPsi |
Factor or indicator residual correlation. This argument must be specified with total variances or error variances. |
totalVarPsi |
Factor or indicator total variances. |
errorVarPsi |
Factor or indicator residual variances. |
gamma |
Regression coefficient matrix from covariates (column) to factors (rows) |
covcov |
A covariance matrix among covariates |
Value
A matrix of factor (model-implied) total covariance
Author(s)
Sunthud Pornprasertmanit (psunthud@gmail.com)
See Also
-
findIndIntercept
to find indicator (measurement) intercepts -
findIndMean
to find indicator (measurement) total means -
findIndResidualVar
to find indicator (measurement) residual variances -
findIndTotalVar
to find indicator (measurement) total variances -
findFactorIntercept
to find factor intercepts -
findFactorMean
to find factor means -
findFactorResidualVar
to find factor residual variances -
findFactorTotalVar
to find factor total variances
Examples
path <- matrix(0, 9, 9)
path[4, 1] <- path[7, 4] <- 0.6
path[5, 2] <- path[8, 5] <- 0.6
path[6, 3] <- path[9, 6] <- 0.6
path[5, 1] <- path[8, 4] <- 0.4
path[6, 2] <- path[9, 5] <- 0.4
facCor <- diag(9)
facCor[1, 2] <- facCor[2, 1] <- 0.4
facCor[1, 3] <- facCor[3, 1] <- 0.4
facCor[2, 3] <- facCor[3, 2] <- 0.4
residualVar <- c(1, 1, 1, 0.64, 0.288, 0.288, 0.64, 0.29568, 0.21888)
findFactorTotalCov(path, corPsi=facCor, errorVarPsi=residualVar)