## Mplus user guide SEM example:
outfile <- tempfile(fileext=".out")
tryres <- try({
download.file("http://www.statmodel.com/usersguide/chap5/ex5.11.html",outfile)
})
if (!is(tryres,"try-error")){
# Plot model:
semPaths(outfile, intercepts = FALSE)
# Extract RAM:
RAM <- modelMatrices(outfile, "ram")
semPaths(do.call(ramModel, RAM), as.expression = "edges", intercepts = FALSE)
# Extract LISREL:
LISREL <- modelMatrices(outfile, "lisrel")
semPaths(do.call(lisrelModel, LISREL), as.expression = "edges", intercepts = FALSE)
}
Run the code above in your browser using DataLab