Description Usage Arguments Details Value Author(s) See Also Examples

It converts models specified in `lavaan`

model syntax to RAM models.

1 2 3 | ```
lavaan2RAM(model, obs.variables = NULL, A.notation = "ON",
S.notation = "WITH", M.notation = "mean", auto.var = TRUE,
std.lv = TRUE, ...)
``` |

`model` |
A character string of model using the lavaan model syntax. |

`obs.variables` |
A character vector of the observed variables. The
observed variables in the RAM specification will follow the order
specified in |

`A.notation` |
A character string to be used in the A matrix if the labels are not included in the lavaan model. For example, the label will be "yONx" for regressing "y" on "x". |

`S.notation` |
A character string to be used in the S matrix if the labels are not included in the lavaan model. For example, the label will be "yWITHx" for the covariance between "y" with "x" and "yWITHy" for the (error) variance of "y". |

`M.notation` |
A character string to be used in the M matrix if the labels
are not included in the lavaan model. For example, the label will be "ymean" for
the mean of "y" if |

`auto.var` |
Logical. If |

`std.lv` |
Logical. If |

`...` |
Further arguments to be passed to |

. Please note that `fixed.x`

is set at `FALSE`

. Thus it cannot be passed to ....

It uses the `lavaanify`

to do the conversion.

A list of RAM specification with `A`

, `S`

, `F`

, and `M`

matrices.

Mike W.-L. Cheung <[email protected]>

`ramModel`

,
`Becker92`

, `Becker09`

,
`Digman97`

, `Hunter83`

,
`as.mxMatrix`

,
`checkRAM`

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | ```
## Regression model on correlation matrix
model1 <- "## y is modelled by x1, x2, and x3
y ~ x1 + x2 + x3
## Fix the independent variables at 1
x1 ~~ 1*x1
x2 ~~ 1*x2
x3 ~~ 1*x3
## Declare the correlations among the independent variables
x1 ~~ x2
x1 ~~ x3
x2 ~~ x3"
## Compare the arrangements of variables with and without
## specifying the obs.variables arguments.
lavaan2RAM(model1, obs.variables=c("y", "x1", "x2", "x3"))
## Two-factor CFA model
model2 <- "f1 =~ x1 + x2 + x3
f2 =~ x4 + x5 + x6
## Declare the correlation between f1 and f2
## and label it with cor_f1f2
f1 ~~ cor_f1f2*f2"
lavaan2RAM(model2)
## Regression model with the mean structure
model3 <- "y ~ x
## Intercept of y
y ~ 1
## Mean of x
x ~ 1"
lavaan2RAM(model3)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.