Parse RI-CLPM syntax once into a lavaan parameter table, using the same options lavriclpm uses to fit the model.

riclpm_partable(riclpmModel)

Arguments

riclpmModel

Model syntax, e.g. from riclpm_text.

Value

A lavaan parameter table (a list with one element per column, as returned by lavaanify).

Details

lavaan accepts a parameter table in place of model syntax. When the same model is fit many times, as in a simulation or a bootstrap, parsing the syntax on every fit is wasted work. Parse it once with this function and pass the table to lavriclpm as riclpmModel. The fit is identical to fitting from the syntax, because both use the same internal set of lavaan options.

Examples

var_groups <- list(x = paste0('x', 1:4), y = paste0('y', 1:4))
model_text <- riclpm_text(var_groups, constrain_over_waves = TRUE)
pt <- riclpm_partable(model_text)

if (FALSE) { # \dontrun{
fits <- lapply(list_of_datasets, function(d) lavriclpm(riclpmModel = pt, data = d))
} # }