Plausible values of factor scores from lavaan.mi (CFA of imputed binary data)

124 views
Skip to first unread message

Athena Chow

unread,
Oct 25, 2022, 11:41:06 AM10/25/22
to lavaan
Dear lavaan discussion group,

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

Terrence Jorgensen

unread,
Nov 7, 2022, 4:11:12 AM11/7/22
to lavaan
You can get plausible values only from blavaan, now that blavaan handles categorical outcomes.  Plausible values of the latent item-responses are also available, although I don't expect that to be in much demand.


Terrence D. Jorgensen
Assistant Professor, Methods and Statistics
Research Institute for Child Development and Education, the University of Amsterdam

Athena Chow

unread,
Nov 15, 2022, 4:12:56 PM11/15/22
to lavaan
Dear Terrence,

Thank you for your reply. I tried using blavaan but the blavPredict() function does not accept my lavaan.mi object. Would you have any advice on how I should proceed? If there is not yet a function available to estimate plausible values of factor scores from imputed binary data, this confirmation would be helpful.

Also, are there any functions available to plot path diagrams from a lavaan.mi object? When I tried the semPaths() function from the semPlot package, it produced this error:
Error in (function (classes, fdef, mtable)  :
  unable to find an inherited method for function ‘semPlotModel_S4’ for signature ‘"lavaan.mi"’

Thank you so much for your time! Any advice is much appreciated.

Best wishes,
Athena

Mauricio Garnier-Villarreal

unread,
Nov 16, 2022, 4:13:24 AM11/16/22
to lavaan
Athena

blavaan wont work with the lavaan.mi object. You would have to estimate the model with blavaan, with the missing data instead of multiple imputations. This way blavaan will handle the missing data with its equivalent of FIML, and them from that object you can extract the plausible values. I havent tested this with categorical indicators yet, but as Terrence says, should work
Reply all
Reply to author
Forward
0 new messages