yrosseel / lavaan

an R package for structural equation modeling and more
http://lavaan.org
429 stars 98 forks source link

lavResiduals() throws an error for some estimators when ordered = FALSE #297

Closed reckak closed 9 months ago

reckak commented 1 year ago

lavResiduals() throws an error for some estimators when ordered = FALSE (but residuals() does not). For example:

`library(lavaan)

HS.model <- ' visual =~ x1 + x2 + x3 textual =~ x4 + x5 + x6 speed =~ x7 + x8 + x9 '

fit <- cfa(HS.model, estimator = "WLSMV", ordered = FALSE, data = HolzingerSwineford1939)

lavResiduals(fit)`

Throws an error Error in lav_model_h1_information_firstorder(lavmodel = lavmodel, lavsamplestats = lavsamplestats, : lavaan ERROR: information = "first.order" not available for estimator ‘DWLS’

yrosseel commented 9 months ago

Thanks. Fixed now!