Skip to content
Prev 300820 / 398503 Next

FIML using lavaan returns zeroes for coefficients

On 07/20/2012 10:35 PM, Andrew Miles wrote:
What happened is that since 0.4-14, lavaan tries to 'detect' models that 
are just univariate regression, and internally calls lm.fit, instead of 
the lavaan estimation engine, at least when the missing="ml" argument is 
NOT used. (BTW, I fail to understand why you would use lavaan if you 
just want to fit a univariate regression).

When missing="ml" is used, lavaan normally checks if you have fixed x 
covariates (which you do), and if fixed.x=TRUE (which is the default). 
In 0.4, lavaan internally switches to fixed.x=FALSE (which implicitly 
assumes that all your predictors are continuous, but I assume you would 
not using missing="ml" otherwise). Unfortunately, for the 'special' case 
of univariate regression, it fails to do this. This behavior will likely 
change in 0.5, where, by default, only endogenous/dependent variables 
will be handled by missing="ml", not exogenous 'x' covariates.

To fix it: simply add the fixed.x=FALSE argument, or revert to 0.4-12 to 
get the old behavior.

Hope this helps,

Yves.
http://lavaan.org