How to get reliability indices for second-order latents in multilevel model using reliabilityL2() ?

90 views
Skip to first unread message

Andreas G.

unread,
May 7, 2020, 6:15:33 AM5/7/20
to lavaan
Hello,

I have the following structure in my two-level model:

model <-
" level: 1
first_order_latent_A =~ item1 + item2 + item3 + item4
first_order_latent_B =~ item5 + item6 + item7 + item8
second_order_latent =~ first_order_latent_A + first_order_latent_B

level: 2
first_order_latent_A =~ ag_item1 + ag_item2 + ag_item3 + ag_item4
first_order_latent_B =~ ag_item5 + ag_item6 + ag_item7 + ag_item8
second_order_latent =~ first_order_latent_A + first_order_latent_B "

Now, I am using 'reliability()' from semTools to get the reliability indices for the first-order-latents and I know that I have to use 'reliabilityL2()' for the second-order-latents.
However, I get an error with the following code that says 'Error in ve[[i]][secondFactor, secondFactor, drop = FALSE] : subscript out of bounds'
reliabilityL2(fitmodel, "second_order_latent")

Is it just not possible to calculate reliability indices with 'reliabilityL2()' for multilevel models? Is there another option how I can arrive at those indices?

Thanks for any advice,

Andreas

Yves Rosseel

unread,
May 13, 2020, 2:27:30 PM5/13/20
to lav...@googlegroups.com
On 5/7/20 12:15 PM, Andreas G. wrote:
> Is it just not possible to calculate reliability indices with
> 'reliabilityL2()' for multilevel models?

I don't think reliability() or reliabilityL2() can handle multilevel
models yet. It is best to open an issue about this on github:

https://github.com/simsem/semTools/issues

Yves.

Andreas G.

unread,
May 14, 2020, 3:31:14 AM5/14/20
to lavaan
Hello Yves,

thank you so much for the answer.
Interestingly, reliability() works with my 2-level-model but of course only gives the values for the first-order-latents.
reliabilityL2() does not work however and I will certainly follow your advice and open an issue about the matter on github.

Do you reckon that if I pretend that the first-order-latents are my observed factors and thus calculate the reliability of my second-order-latents with reliability() - leaving out my observed items altogether - that the alpha and omega values should be accurate or is this approach inappropriate?
Or would there be any other way to get my reliability values using my lavaan output (I am not really able to do it by hand)?

Best regards,

Andreas

Andreas G.

unread,
May 14, 2020, 5:21:05 AM5/14/20
to lavaan
Dear all,

it seems that updating semTools solved my problems and that reliabilityL2() works with multilevel models as well.
My apologies for not having tried this out earlier as standard procedure dictates ...

Terrence Jorgensen

unread,
May 15, 2020, 10:48:37 AM5/15/20
to lavaan
I don't think reliability() or reliabilityL2() can handle multilevel
models yet.

They both can, as Andreas discovered when he posted on GitHub:  https://github.com/simsem/semTools/issues/74

Here is a reprex:

model <- '
    level: 1
        f1 =~ y1 + y2 + y3
        f2 =~ y4 + y5 + y6
        hi =~ 1*f1 + 1*f2
    level: 2
        f1 =~ y1 + y2 + y3
        f2 =~ y4 + y5 + y6
        hi =~ 1*f1 + 1*f2
'
fit <- sem(model, data = Demo.twolevel, cluster = "cluster")
reliability(fit)
reliabilityL2(fit, secondFactor = "hi")

Terrence D. Jorgensen
Assistant Professor, Methods and Statistics
Research Institute for Child Development and Education, the University of Amsterdam
 
Reply all
Reply to author
Forward
0 new messages