Unbiased SRMR and confidence interval

349 views
Skip to first unread message

Brenton Wiernik

unread,
Apr 8, 2019, 8:49:29 AM4/8/19
to lavaan
In their paper describing unbiased estimators and CIs for SRMR and CRMR, Maydeu-Olivares, Shi, and Rosseel indicate that these estimators and CIs are available in lavaan, but I am not seeing them anywhere in GitHub source code. Are they available yet in lavaan?

https://www.tandfonline.com/doi/abs/10.1080/10705511.2017.1389611

PD

unread,
Apr 8, 2019, 10:30:51 AM4/8/19
to lavaan
Are these not available in the lavResiduals function (https://github.com/cran/lavaan/blob/master/R/lav_residuals.R)?

Brenton Wiernik

unread,
Jul 23, 2019, 12:12:49 PM7/23/19
to lavaan
Sorry for not replying. Thanks for pointing this out!

William M

unread,
Jan 3, 2020, 2:02:21 PM1/3/20
to lavaan
My apologies for the probably silly question-- I am not good at reading source code. When I use lavResiduals I get the unbiased SRMR (or CRMR, etc.) and SE but not the Z-test or p-value. Is there a way to customize the function so that I get the test info for the unbiased estimate rather than only the biased sample SRMR?

Terrence Jorgensen

unread,
Jan 3, 2020, 5:34:02 PM1/3/20
to lavaan
When I use lavResiduals I get the unbiased SRMR (or CRMR, etc.) and SE but not the Z-test or p-value.

It's easy enough to add it to the data.frame in the $summary part of the output.

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

fit
<- cfa(HS.model, data = HolzingerSwineford1939)
R
<- lavResiduals(fit)
R$summary$usrmr
.z <- R$summary$usrmr / R$summary$usrmr.se
R$summary$usrmr
.pvalue <- 2*pnorm(-R$summary$usrmr.z)
R


Is there a way to customize the function so that I get the test info for the unbiased estimate rather than only the biased sample SRMR?

You could wrap it up in a function.

myResids <- function(object) {
  R
<- lavResiduals(object)
  R$summary$usrmr
.z <- R$summary$usrmr / R$summary$usrmr.se
  R$summary$usrmr
.pvalue <- 2*pnorm(-R$summary$usrmr.z)
  R
}

myResids
(fit)

Terrence D. Jorgensen
Assistant Professor, Methods and Statistics
Research Institute for Child Development and Education, the University of Amsterdam

William M

unread,
Jan 3, 2020, 7:45:21 PM1/3/20
to lav...@googlegroups.com
Thank you!

--
You received this message because you are subscribed to a topic in the Google Groups "lavaan" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/lavaan/m-GUry6C3yE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to lavaan+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lavaan/72cfc3ce-250f-4cd8-8255-2f1adc5a1d77%40googlegroups.com.

Yves Rosseel

unread,
May 4, 2020, 5:03:29 AM5/4/20
to lav...@googlegroups.com
In dev lavaan 0.6-6, the output of the summary section in lavResiduals()
now contains CI for the unbiased S/CRMS, as well as better labelling of
the ouput:

For the Holzinger & Swineford example (including a meanstructure), it
now looks like this:

$summary
cov mean total
srmr 0.065 0.00 0.060
srmr.se 0.006 NA 0.005
srmr.exactfit.z 6.063 NA 6.063
srmr.exactfit.pvalue 0.000 NA 0.000
usrmr 0.058 0.00 0.053
usrmr.se 0.010 NA 0.009
usrmr.ci.lower 0.042 NA 0.039
usrmr.ci.upper 0.074 NA 0.067
usrmr.closefit.h0.value 0.050 0.05 0.050
usrmr.closefit.z 0.832 NA 0.336
usrmr.closefit.pvalue 0.203 NA 0.369

Yves.


On 1/3/20 8:02 PM, William M wrote:
> My apologies for the probably silly question-- I am not good at reading
> source code. When I use lavResiduals I get the unbiased SRMR (or CRMR,
> etc.) and SE but not the Z-test or p-value. Is there a way to customize
> the function so that I get the test info for the unbiased estimate
> rather than only the biased sample SRMR?
>
> On Monday, April 8, 2019 at 10:30:51 AM UTC-4, PD wrote:
>
> Are these not available in the lavResiduals function
> (https://github.com/cran/lavaan/blob/master/R/lav_residuals.R
> <https://github.com/cran/lavaan/blob/master/R/lav_residuals.R>)?
>
>
> On Monday, April 8, 2019 at 2:49:29 PM UTC+2, Brenton Wiernik wrote:
>
> In their paper describing unbiased estimators and CIs for SRMR
> and CRMR, Maydeu-Olivares, Shi, and Rosseel indicate that these
> estimators and CIs are available in lavaan, but I am not seeing
> them anywhere in GitHub source code. Are they available yet in
> lavaan?
>
> https://www.tandfonline.com/doi/abs/10.1080/10705511.2017.1389611 <https://www.tandfonline.com/doi/abs/10.1080/10705511.2017.1389611>
>
> --
> 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
> <mailto:lavaan+un...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/lavaan/bb9b6402-b96d-49bd-9dcb-68454175c943%40googlegroups.com
> <https://groups.google.com/d/msgid/lavaan/bb9b6402-b96d-49bd-9dcb-68454175c943%40googlegroups.com?utm_medium=email&utm_source=footer>.

--
Yves Rosseel -- http://www.da.ugent.be
Department of Data Analysis, Ghent University
http://lavaan.org

Paul Connor

unread,
Jun 12, 2023, 11:43:29 AM6/12/23
to lavaan
Hi, quick question - the lavResiduals summary output for a multigroup SEM has three columns, 'cov', 'mean', and 'total'. I am pretty sure the key estimates are under 'cov' (the usrmr under cov for group A lines up with the usrmr from lavResiduals for a SEM fit using just group A) but I am curious what 'mean' and 'total' refer to? 

I assumed they meant mean across the groups and total for the entire sample, but that can't be right because I get a different figure under total across groups. 

Paul

Terrence Jorgensen

unread,
Jun 13, 2023, 11:38:24 AM6/13/23
to lavaan
I am curious what 'mean' and 'total' refer to? 

The "mean" column is (S/C)RMR calculated using mean residuals.
The "total" column is (S/C)RMR calculated using both mean and covariance residuals.
Reply all
Reply to author
Forward
0 new messages