bootstrap error

44 views
Skip to first unread message

Michael Filsecker

unread,
Jul 21, 2025, 12:38:05 PMJul 21
to lav...@googlegroups.com
Dear all,

I was playing with lavaan and run this code (generated by chatgpt):
fit <- cfa(model,
           data = HolzingerSwineford1939,
           se = "bootstrap",       # bootstrap standard errors
           bootstrap = 1000        # number of bootstrap samples
)

but I got the following error: (no idea what went wrong...)
Warnmeldung:
lavaan->lav_model_nvcov_bootstrap():  
   5 bootstrap runs resulted in nonadmissible solutions. 


Thank you!!
Michael.

Edward Rigdon

unread,
Jul 24, 2025, 2:06:44 PMJul 24
to lav...@googlegroups.com
Michael--
     The warning (not error) message just says that some of your bootstrap replications produced unacceptable values for some parameter estimates, most likely some negative error variances.. If the population values for these residual variances are close to 0, then across enough replications you will get some estimates that are less than zero, purely as a matter of random sampling variance. You should still have all results available. Ken Bollen wrote a paper on this topic, suggesting that negative residual variances due to random sampling error could be safely ignored. If these negative residual variances are a problem,  you could add an inequality constraint to your model,m specifying that residual variances involved must be greater than 0.

--
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/CACXLW8_i5tmTLmPNskzn5qbDGUnbJ7r%3DAoAU3%3D_mtab_hEJXYg%40mail.gmail.com.
Message has been deleted

Michael Filsecker

unread,
Aug 2, 2025, 3:03:15 AMAug 2
to lavaan
thank you dear Edward!!

Have a nice weekend:)
Michael.

Reply all
Reply to author
Forward
0 new messages