Hi all,
I’m fitting a bivariate latent change score (LCS) model in lavaan and want to test sex differences using multigroup (group = "sex") while accounting for family-level clustering (cluster = "family"). In my data, families can have members in both sex groups. Most families are singletons, with relatively little families with multiple siblings (about 15%).
My ideal workflow:
However, I’m running into challenges because clustering is not nested within group (the same family identification number can appear in both groups). When I try:
fit <- lavaan(
model = lcs_model,
data = dat,
group = "sex",
cluster = "family",
estimator = "MLR",
fixed.x = FALSE,
missing = "fiml"
)
I get errors (e.g., “subscript out of bounds”), and more broadly I’m unsure whether lavaan supports this design when clusters span groups. I don't get the error when I use ML as estimator and remove the clustering argument completely, but then I have not dealt with family clustering when comparing sex groups.
I have considered using lavaan.survey but it is currently not available within my R environment. It would be a great help to receive some suggestions on how to deal with cross-group clustering in multigroup fits using lavaan.
Thanks!
--
You received this message because you are subscribed to the Google Groups "lavaan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lavaan+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/lavaan/4d56c1d8-6e0c-42a6-adfb-ec08021af1afn%40googlegroups.com.