SRMR calculation when mean structure is included vs. not

45 views
Skip to first unread message

Aditi Bhangale

unread,
Oct 8, 2025, 9:54:44 AM (2 days ago) Oct 8
to lavaan

Hello, 

I have a question regarding the difference between the SRMR value for a fitted model when the mean structure is included vs. not. 

I noticed that the output for fitMeasures() and lavResiduals() differs slightly based on whether the mean structure has been included in the model or not. 

See the following example: 

HS.model <- ' visual  =~ x1 + x2 + x3

              textual =~ x4 + x5 + x6

              speed   =~ x7 + x8 + x9 '


fit1 <- cfa(HS.model, data = HolzingerSwineford1939) # mean structure not included

fit2 <- cfa(HS.model, data = HolzingerSwineford1939, meanstructure = T) # mean structure included


# for fitted model wherein mean structure is not included (fit1)

fitMeasures(fit1)["srmr"]

lavResiduals(fit1)$summary["srmr",]

## above SRMR values match


# for fitted model wherein meanstructure is included (fit2)

fitMeasures(fit2)["srmr"]

lavResiduals(fit2)$summary["srmr",]


For fit2 (when mean structure is included), why is there an additional mean and total column in the lavResiduals() output? Additionally, why is the value for the cov column different from that of the total column (I find this confusing because the mean column is 0—though this may only be the rounded value—as I would assume that the total column is a sum of the cov and mean columns)? 

Thanks for the help!


Aditi

Victoria Savalei

unread,
Oct 8, 2025, 3:59:04 PM (2 days ago) Oct 8
to lavaan
Hi Aditi, when you explicitly request a mean structure, you are asking to view the model as a mean and covariance structure model, and the residuals for the mean structure will also be stored (see lavResiduals(fit2)$mean). These should be zero when the mean structure is saturated (there are some weird exceptions, like with missing data, when they are almost but not exactly zero), so the average root mean square residual for the mean structure is zero. The total column in this case computes the average root mean square residual over all mean and covariance structure residuals, so it will be lower if the mean structure is saturated because it mixes in a bunch of zeros into the average. One could say it artificially inflates model fit, and for models with a saturated mean structure, we should probably only look at the $cov version of the SRMR. 

Aditi Bhangale

unread,
Oct 9, 2025, 5:50:26 AM (yesterday) Oct 9
to lavaan

Hi Vika, 

Thank you for the clear explanation. I tried calculating SRMR both ways (including mean structure and not) using a function I wrote and was able to reproduce the lavaan output, so this makes sense to me now.

Aditi

Reply all
Reply to author
Forward
0 new messages