View source: R/modelMatrices.R
| modelMatrices | R Documentation |
Create a "semMatriModel" object. Use semMatrixAlgebra to extract or compute with these models. The structure of "semMatriModel" objects is chosen such that they can be used to create a semPlotModel-class object using do.call in combination with ramModel, lisrelModel or mplusModel (not yet implemented). See details.
modelMatrices(object, model = "ram", endoOnly = FALSE)
object |
A |
model |
Model to be used, |
endoOnly |
Only needed when the model is |
The "lisrel" model uses the following matrix names: LY, TE, PS, BE, LX, TD, PH, GA, TY, TX, AL and KA. Regressions on manifest variables will cause dummy latents to be included in the model.
The "mplus" model uses the following matrix names: Lambda, Nu, Theta, Kappa, Alpha, Beta, Gamma and Psi.
The "ram" model uses the following matrix names: F, A and S.
a "semMatriModel" object
Sacha Epskamp <mail@sachaepskamp.com>
semPlotModel
semPlotModel-class
semMatrixAlgebra
lisrelModel
ramModel
## 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)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.