Learn R Programming

simsem (version 0.2-8)

simMatrix: Create simMatrix that save free parameters and starting values, as well as fixed values

Description

Create SimMatrix object that save free parameters and starting values, as well as fixed values. This will be used for model specification later, such as for factor loading matrix or regression coefficient matrix.

Usage

simMatrix(free = NULL, value = NULL)

Arguments

free
Matrix of free parameters. Use NA to specify free parameters. Use number as fixed value (including zero). If this argument is not specified, the information from the value argument is used. The positions in the value
value
Starting values. Can be either one element or matrix with the same dimension as free parameter matrix. Each element can be numbers (in either as.numeric or as.character format) or the name of distribution object

Value

  • SimMatrix object that will be used for model specification later.

See Also

  • SeeVirtualDistfor the resulting object.
  • SeesymMatrixfor creating symmetric simMatrix.
  • SeesimVectorfor simVector.

Examples

Run this code
loading <- matrix(0, 6, 2)
loading[1:3, 1] <- NA
loading[4:6, 2] <- NA
loadingValues <- matrix(0, 6, 2)
loadingValues[1:3, 1] <- 0.7
loadingValues[4:6, 2] <- 0.7
LX <- simMatrix(loading, loadingValues)
summary(LX)
run(LX)

n65 <- simNorm(0.6, 0.05)
LY <- simMatrix(loading, "n65")
summary(LY)
run(LY)

start <- matrix(0, 6, 2)
start[1:3, 1] <- 0.7
start[4:6, 2] <- 0.7
ST <- simMatrix(value=start)

Run the code above in your browser using DataLab