# NOT RUN {
## Stage 1 analysis
rand1 <- tssem1(Boer16$data, Boer16$n, method="REM", RE.type="Diag", acov="individual")
summary(rand1)
## Stage 2 analysis
model2a <- 'JS+OC+LE ~ LMX+TFL
LMX ~ TFL
## Variance of TFL is fixed at 1
TFL ~~ 1*TFL
## Correlated residuals
JS ~~ OC
JS ~~ LE
OC ~~ LE'
## Display the model
plot(model2a)
RAM2a <- lavaan2RAM(model2a, obs.variables = c("LMX", "TFL", "JS", "OC", "LE"),
A.notation="on", S.notation="with")
rand2a <- tssem2(rand1, Amatrix=RAM2a$A, Smatrix=RAM2a$S)
summary(rand2a)
## Display the model with the parameter estimates
plot(rand2a, layout="spring")
# }
Run the code above in your browser using DataLab