Hi there, Thanks for having this forum where we can solve our questions.
I'm moving from Mplus to lavaan, but something is going on when I compare simple results.
I have a dataset with 29 latent variables. My MPLUS code is:
VARIABLE:
NAMES ARE y1-y31;
USEVARIABLES ARE y1-y29;
MISSING IS *;
CATEGORICAL IS y1-y29;
ANALYSIS:
PROCESS = 4;
ESTIMATOR = WLSMV;
MODEL:
envolv by y1-y9;
trein by y10-y12;
cond by y13-y17;
desemp by y18-y22;
remun by y23-y26;
IR by y27-y29;
In lavaan, the code is:
mod_cfa <-'
#latent
envolv =~ y1 + y2 + y3 + y4 + y5 + y6 + y7 + y8 + y9
trein =~ y10 + y11 + y12
cond =~ y13 + y14 + y15 + y16 + y17
desemp =~ y18 + y19 + y20 + y21 + y22
remun =~ y23 + y24 + y25 + y26
IR =~ y27 + y28 + y29'
cfa_all <- sem(model = mod_cfa, #get the model
data = dados, #dataset
estimator = 'WLSMV', #estimator for categorical
ordered = colnames(dados[1:29]), #categorical measurement
Mplus gives me a report of my model with no warnings, but lavaan tells me:
Warning message:
In lav_model_vcov(lavmodel = lavmodel, lavsamplestats = lavsamplestats, :
lavaan WARNING:
The variance-covariance matrix of the estimated parameters (vcov)
does not appear to be positive definite! The smallest eigenvalue
(= -6.479800e-17) is smaller than zero. This may be a symptom that
the model is not identified.
What is happening ?
Second question: there are any possibility to use "y1 by y9" in lavaan ?
Data is attached to this message.
Thank you.