After using the Amelia package to impute datasets, I have fit a lavaan model to the list of multiple imputed datasets using cfa.mi() from the semTools package, and I want to draw plausible values of factor scores estimated from the fitted model of class lavaan.mi.
Ideally, I would like to save the plausible factor scores corresponding to each participant back into each of the imputed datasets, and then use the Zelig() function to run regressions on each imputed dataset (using the plausible factor scores as predictors within each dataset), and finally pool the estimates across all datasets.
However, when I tried using the plausibleValues() function this error was produced:
Error in FUN(X[[i]], ...) :
Plausible values not available (yet) for categorical data
I realised this is because all of my variables were coded as binary (0 or 1 representing the presence of risk). I am certain the issue is due to my binary data, because I tried refitting my cfa.mi() model without the "ordered = TRUE" argument and plausibleValues() was able to extract the plausible factor scores.
I did search the discussion group archives to see if anyone had similar experiences and the closest issues I could find were
this 2021 thread and
this 2020 thread, both of which implied plausibleValues() would be updated in the future.
I would really appreciate advice on the following questions:
1) Will plausibleValues be available for categorical data soon?
2) If plausibleValues will not be available for categorical data soon, how can I estimate the plausible factor scores to be saved into each imputed dataset, using the output of the lavaan.mi fitted model that was produced by cfa.mi()?
3) As this is my first time conducting this type of analysis, I would appreciate any advice on how to estimate plausible factor scores to be saved into each imputed dataset even if not through the lavaan.mi method, as long as it is compatible with my imputed datasets (class Amelia).
4) Are there any functions available to plot path diagrams from a lavaan.mi model? I tried the semPaths() function from the semPlot package but it didn't work, maybe because it only accepts lavaan objects?
Here is a snippet of my code (note: my data is a.out$imputations to access the imputed datasets from the Amelia object). I am using the 0.6-12 version of lavaan and the 0.5-6 version of semTools.
# Define 3-factor model in lavaan syntax
f3 <- ' factor1 =~ x1 + x2 + x3 + x4 + x5 + x6 + x7
factor2 =~ x8 + x9 + x10 + x11 + x12
factor3 =~ x13 + x14 + x15 + x16 + x17 + x18 '
# Fit 3-factor model on imputed data
imp_cfa_f3 <- cfa.mi(f3, data=a.out$imputations,
rotation = "oblimin", estimator = "WLSMV", ordered = TRUE)
summary(imp_cfa_f3, fit.measures = TRUE)
# Estimate plausible factor scores
imp_fscores <- plausibleValues(imp_cfa_f3, nDraws = 5)
Thank you!
Best wishes,
Athena Chow