Converts SEM models to RAM models for OpenMx.

as_ram(x, ...)

Arguments

x

An object for which a method exists, such as a tidy_sem object, or character vector describing the user-specified model using the lavaan model syntax.

...

Parameters passed on to other functions.

Value

Returns an mxModel.

Details

For models specified using lavaan syntax, the procedure is as follows:

  1. Apply lavaanify to the model. The default arguments to lavaanify correspond to those of the sem function.

  2. Convert each row of the resulting lavaan parameter table to a mxPath.

  3. Apply mxModel to the mxPaths to create an OpenMx model using RAM specification

Examples

as_ram("y ~ x")
#> MxModel 'model' #> type : RAM #> $matrices : 'A', 'S', and 'F' #> $algebras : NULL #> $constraints : NULL #> $intervals : NULL #> $latentVars : none #> $manifestVars : 'y' and 'x' #> $data : NULL #> $submodels : NULL #> $expectation : MxExpectationRAM #> $fitfunction : MxFitFunctionML #> $compute : NULL #> $independent : FALSE #> $options : #> $output : FALSE