first time lavaan user

60 views
Skip to first unread message

Shawn B

unread,
Jan 1, 2025, 1:22:31 PM1/1/25
to lavaan
Hi, I'm trying to make a structured equation model using lavaan in R. However, I am getting an error that makes no sense. 

The error is:
Warning message: lavaan->lav_lavaan_step11_estoptim(): Model estimation FAILED! Returning starting values.

The model I am using is:

library (lavaan)

model <- '

persontrust  =~ family + friends

demographic =~ age + gender + income + education + region + everlied

instittrust =~ doctors+politicians+religious+businessowners

soctrust =~ salespeople + celebrities + commercialactors + socmediainfluencers + newimmigrants

infotrust =~ Buswebsite + BusFacebookpage + periodicals + internetsearch + googlebuslisting + internetdiscussforum + consumerratingssite

strangersonstreet ~ persontrust + demographic + instittrust+ soctrust+ infotrust

 '

trustmodel_out <- sem(trustmodel, data=trustdat2)


What could be the issue and what does that error mean?

Thank you

Jeremy Miles

unread,
Jan 1, 2025, 8:49:09 PM1/1/25
to lav...@googlegroups.com
It could be a few things.

First, it looks like a typo in your code.

You start by creating a model, called model: model <- '

But then you fit a model called trustmodel.
trustmodel_out <- sem(trustmodel, data=trustdat2)

If that's not it, this is a weird latent variable (if those variables are what they look like):

demographic =~ age + gender + income + education + region + everlied

What's your sample size?

Can you show us the covariance matrix of the data?



--
You received this message because you are subscribed to the Google Groups "lavaan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lavaan+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/lavaan/bfade585-86fd-4cba-8505-f8a37315c5d3n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages