simsem / semTools

Useful tools for structural equation modeling
75 stars 36 forks source link

Summary of lavaan.mi fails with unclear error #75

Closed LukasWallrich closed 4 years ago

LukasWallrich commented 4 years ago

Hi there,

I am running a mediation model with multiple imputation and am getting the following error in the summary function:

Error in if (attr(x, "se") == "robust.huber.white" && attr(x, "information.meat") !=  : 
  missing value where TRUE/FALSE needed
In addition: Warning message:
In if (attr(x, "information") == "observed") { :
  the condition has length > 1 and only the first element will be used

The model is fitted with mod <- semTools::runMI(model, imp_long_list_with_dummy_sd, fun = "sem", sampling.weights = "wt"). coef() works fine. Any suggestions how I can proceed, particularly in order to get significance tests for the coefficients, would be very much appreciated.

I am happy to provide more information, but am not sure what would be most helpful.

LukasWallrich commented 4 years ago

traceback() shows that the error appears to come from print.lavaan.parameterEstimates, probably because the "information.meat" attribute is not set - but as I don't know how to trace/debug methods, I can't investigate further.

TDJorgensen commented 4 years ago

(h1.)information.meat are new attributes of the lavaan.parameterEstimates class. I have just added them to the summary() method for lavaan.mi objects, so this should be resolved in the development version (0.5-3.909; see the Wiki for syntax to install from GitHub). If the error goes away, please close the issue; otherwise, I might need a reproducible example to find out what is going on. Thanks.