I'm getting the following warning when trying to run a CFA, and googling hasn't helped:
"Model estimation FAILED! Returning starting values.Error in Sigma.inv * sample.cov : non-conformable arrays"
The model ran in MPlus for a colleague, so I'm wondering if I somehow "translated" it wrong into lavaan.
Background: I'm trying to replicate a colleague's analyses that were originally performed in MPlus. I have the original data as well as his .inp files. He split the data into exploratory and confirmatory sets before estimating several models, and I'm getting the same error for all the models in both data sets.
I'll just give an example of one model and data set--the final model in the confirmatory data set, which includes 514 participants with no missing data in the variables used in the model.
My code: Note that the mplus2lavaan function had trouble parsing the models (it seemed particularly tripped up by commented-out lines in the MPlus syntax), so I had to translate these by hand, not being familiar with MPlus syntax. It's very possible that I've made some error in the translation. It's a pretty straightforward hierarchical measurement model, albeit with a lot of factors.
thriving_model_final_conf <-
'FGrowmind =~ GrowM2 + GrowM5 + GrowM8
FCogFlex =~ CogFlex2 + CogFlex5 + CogFlex6
FReflect =~ Reflect1 + Reflect3 + Reflect5 + Reflect6
FProspect =~ Prosp4 + Prosp7 + Prosp8
FAttenReg =~ AttenReg1 + AttenReg3 + AttenReg5
FFocus =~ Focus4R + Focus7R + Focus10R
FEmoReg =~ EmoReg1 + EmoReg2 + EmoReg5 + EmoReg7
FActive =~ Active2 + Active7 + Active10
FNourish =~ Nourish2 + Nourish3 + Nourish7
FRest =~ Rest1 + Rest2 + Rest5
FConnect =~ Connect2 + Connect4 + Connect5
FExpress =~ Express1 + Express2 + Express5
FGive =~ Gives2 + Gives3 + Gives5
GCognitive =~ FGrowmind + FCogFlex + FProspect + FAttenReg
GEmotional =~ FFocus + FEmoReg
GPhysical =~ FActive + FNourish + FRest
GSocial =~ FConnect + FExpress + FGive
HThriving =~ GCognitive + GEmotional + GPhysical + GSocial'
thriving_final_conf_results <- lavaan(model = thriving_model_final_conf, data = df_thriving_final_conf)What I've tried so far (all shots in the dark): - Everything below returns the warning, "Warning: lavaan WARNING: Model estimation FAILED! Returning starting values.Error in Sigma.inv * sample.cov : non-conformable arrays
- Restricting the data frame to include only the variables in the model
- Changing the data frame to a matrix (as.matrix())
- Passing the lavaan function a covariance matrix rather than the raw data (using the code thriving_final_conf_results <- lavaan(model = thriving_model_final_conf, sample.cov = final_cov, sample.nobs = 514)
- I also tried different estimators.
- GLS produces this warning: Warning: lavaan WARNING:Could not compute standard errors! The information matrix could not be inverted. This may be a symptom that the model is not identified.
- WLS produces a warning and an error: Warning: lavaan WARNING: number of observations (514) too small to compute Gamma; Error in lav_samplestats_from_data(lavdata = lavdata, lavoptions = lavoptions, lavaan ERROR: Gamma (NACOV) matrix is not positive-definite
- ULS and DWLS produce these warnings: Warning: lavaan WARNING: number of observations (514) too small to compute Gamma; Warning: lavaan WARNING: Could not compute standard errors! The information matrix could not be inverted. This may be a symptom that the model is not identified.
- DLS produces these warnings: Warning: lavaan WARNING: number of observations (514) too small to compute Gamma; Warning: lavaan WARNING: Model estimation FAILED! Returning starting values.
Is it possible that there are different default assumptions about unspecified parameters, or different default estimation methods, in lavaan vs. MPlus that would produce these errors? Any other ideas?
Many thanks, muchas gracias, grazie mille, merci mille fois ....