lavCor() ubiquitously sets correlation = categorical
TDJorgensen opened this issue · 0 comments
This is not a problem for the default behavior of lavCor(..., output = "cor")
, but when lavCor(..., output = "fit")
and any variables are ordered=
, the saturated model generated by lav_partable_unrestricted()
will fix ALL variances to 1, not just the latent-response variances for ordered=
variables. This is not a problem when ALL variables are ordered=
, but with a mix of categorical and continuous variables, an inappropriately restrictive correlation=TRUE
model is fitted:
HS3 <- HolzingerSwineford1939[,c("x1","x2","x3","sex")]
parTable(lavCor(HS3, ordered = "sex", output = "fit"))
Granted, the model isn't actually fitted, sbut it does not seem necessary to set correlation=categorical
here.
- None of the output depends on all the variables having a variance fixed to 1 during estimation, since
lav_cor_output()
appliescov2cor()
orstandardizedSolution()
anyway. - The
lav.data
object informslav_partable_unrestricted()
which variables areordered=
, so those particular variances are fixed to 1 anyway.
So I think correlation=categorical
can be deleted without affecting anything lavCor()
is utilized for, except that the correct model is specified when output = "fit"
. That is something lavaan.mi::poolSat()
utilizes, which is how some noticed this when trying to fit an efa()
to multiply imputed data.