add_custom_covs | R Documentation |
Append lavaan syntax with group-specific covariances
add_custom_covs(model, group, data, cov, focal.groups)
model |
character, lavaan syntax model |
group |
character, grouping variable |
data |
data frame |
cov |
character, covariance to add, e.g. "variable1 ~~ variable2" |
focal.groups |
Character vector for the groups to add the cov. |
cov.model <- "F =~ v1 + v2 v3 + v4 + v5"
cov.model.custom.covs <-
lav.mod %>%
add_custom_covs("country", dat1,
"v1 ~~ v3", c("China", "Indonesia")) %>%
add_custom_covs("country.f", dat1,
"v2 ~~ v3", c("Israel"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.