Learn R Programming

simsem (version 0.2-8)

SimMatrix-class: Matrix object: Random parameters matrix

Description

This object can be used to represent a matrix in SEM model. It contains free parameters, fixed values, and starting values. This object can be represented factor loading matrix or regreesion coefficient matrix.

Arguments

Objects from the Class

This object is created by "simMatrix" function. Objects can be also created by calls of the form new("SimMatrix", ...).

See Also

  • SymMatrixfor symmetric random parameter matrix
  • SimVectorfor random parameter vector.

Examples

Run this code
showClass("SimMatrix")

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)

u34 <- simUnif(0.3, 0.4)
LY <- adjust(LY, "u34", c(2, 1))
summary(LY)
run(LY)
summaryShort(LY)

LY <- extract(LY, 1:3, 1)
summary(LY)

Run the code above in your browser using DataLab