Learn R Programming

simsem (version 0.2-8)

simParamSEM: Create a set of matrices of parameters for analyzing data that belongs to SEM model

Description

This function will create set of matrices of free parameters that belongs to full SEM model. The requirement is to specify regression coefficient matrix and factor loading matrix.

Usage

simParamSEM(..., exo = FALSE)

Arguments

...
Each element of model specification, as described in Details
exo
specify TRUE if users wish to specify both exogenous and endogenous indicators.

Value

  • SimParam object that represents the path analysis model free parameters. This will be used for building SimModel later.

Details

The matrices and vectors in the endogenous side are
  • LYfor factor loading matrix from endogenous factors to Y indicators (need to be a matrix).
  • TEfor measurement error covariance matrix among Y indicators (need to be a symmetric matrix).
  • BEfor regression coefficient matrix among endogenous factors (need to be a matrix).
  • PSfor residual covariance matrix among endogenous factors (need to be a symmetric matrix).
  • TYfor measurement intercepts of Y indicators. (need to be a vector).
  • ALfor endogenous factor intercept (need to be a vector).
There are two required matrices for the specification in the endogenous side only: LY and BE. If users need to specify exogenous variable too ("exo=TRUE"), these matrices and vectors are available:
  • LXfor factor loading matrix from exogenous factors to X indicators (need to be a matrix).
  • TDfor measurement error covariance matrix among X indicators (need to be a symmetric matrix).
  • GAfor regression coefficient matrix among exogenous factors (need to be a matrix).
  • PHfor residual covariance matrix among exogenous factors (need to be a symmetric matrix).
  • TXfor measurement intercepts of Y indicators. (need to be a vector).
  • KAorMKfor total mean of exogenous factors (need to be a vector).
  • THfor measurement error covariance between X measurement error and Y measurement error (need to be a matrix).
There are four required matrices for the specification in both exogenous and endogenous sides: LY, , BE, LX, and GA. The default specifications if exo=FALSE are
  1. If residual factor covariance is not specified, then (a) all factor variances are free, (b) all exogenous covariances are free, (c) all endogenous covariances are fixed.
  2. If factor means vector is not specified, then the factor means are free.
  3. If error covariance matrix is not specified, the default is to estimate all error variances and not estimate error covariances.
  4. If measurement intercept vector is not specified, the default is to estimate all measurement intercepts.
The default specifications if exo=TRUE are
  1. If endogenous factor covariance (PS) is not specified, then (a) all endogenous factor variances are free, (b) all endogenous factor covariances are fixed.
  2. If endogenous factors regression coefficient (BE) is not specified, then all coefficients are specified as zero.
  3. If factor means (KA or AL) are not specified, all indictor means are free.
  4. If exogenous factor covariance matrix (PH) is not specified, then the matrix is free in every element.
  5. If error covariance matrix (TE, TD, or TH) is not specified, the default is to estimate all error variances and not estimate error covariances.
  6. If measurement intercept vector (TX or TY) is not specified, the default is to estimate all measurement intercepts.

See Also

  • See classSimParamfor the free parameters object details.
  • UsesimParamCFAto specify CFA model and usesimParamPathto specify path analysis model.

Examples

Run this code
loading <- matrix(0, 8, 3)
loading[1:3, 1] <- NA
loading[4:6, 2] <- NA
loading[7:8, 3] <- NA
path <- matrix(0, 3, 3)
path[3, 1:2] <- NA
SEM.model <- simParamSEM(BE=path, LY=loading)

loading.X <- matrix(0, 6, 2)
loading.X[1:3, 1] <- NA
loading.X[4:6, 2] <- NA
loading.Y <- matrix(NA, 2, 1)
path.GA <- matrix(NA, 1, 2)
BE <- as.matrix(0)
SEM.Exo.model <- simParamSEM(GA=path.GA, BE=BE, LX=loading.X, LY=loading.Y, exo=TRUE)

Run the code above in your browser using DataLab