# 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'
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)
my.plot2a <- meta2semPlot(rand2a)
semPlot::semPaths(my.plot2a, whatLabels="est", sizeMan=8,
edge.label.cex=1.5, color="yellow",
edge.color = "black", weighted=FALSE, layout="tree2")
# }
Run the code above in your browser using DataLab