Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

modelMatrices

Extract SEM model matrices


Description

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.

Usage

modelMatrices(object, model = "ram", endoOnly = FALSE)

Arguments

object

A "semPlotModel" object or any of the input types that can be used in semPlotModel directly.

model

Model to be used, "mplus", "ram" or "lisrel"

endoOnly

Only needed when the model is "lisrel", sets all variables to endogenous.

Details

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.

Value

a "semMatriModel" object

Author(s)

Sacha Epskamp <mail@sachaepskamp.com>

See Also

Examples

## Mplus user guide SEM example:
outfile <- tempfile(fileext=".out")
download.file("http://www.statmodel.com/usersguide/chap5/ex5.11.out",outfile)

# 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)

semPlot

Path Diagrams and Visual Analysis of Various SEM Packages' Output

v1.1.2
GPL-2
Authors
Sacha Epskamp [aut, cre], Simon Stuber [ctb], Jason Nak [ctb], Myrthe Veenman [ctb], Terrence D. Jorgensen [ctb] (<https://orcid.org/0000-0001-5111-6773>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.