Fixing parameters to equality using sam()

45 views
Skip to first unread message

Manuel Rein

unread,
Nov 2, 2022, 7:30:01 AM11/2/22
to lavaan
Hello,

I want to fix factor loadings across two factors to equality. However, lavaan seems to ignore that and estimates them freely. Below is an example code:
---------------------------------------------------------------
library(lavaan)
HS.model <- " visual =~ x1 + x2 + x3
textual =~ x4 + l2*x5 + x6
speed =~ x7 + l2*x8 + x9
"
# SEM
sem_fit <- sem(HS.model, data = HolzingerSwineford1939)
summary(sem_fit)
---------------------------------------------------------------

It can be seen that the factor loadings of x5 and x8 are equal (1.125).
However, using the sam() the loadings differ:
---------------------------------------------------------------
# SAM
sam_fit <- sam(HS.model, data = HolzingerSwineford1939, output = "list")
sam_fit$LAMBDA

--------------------------------------------------------------
Here, the factor loadings are 1.133 and 1.225.

Is there a way to fix the loadings to equality?

Kind regards
Manuel Rein



Jasper Bogaert

unread,
Nov 2, 2022, 8:39:18 AM11/2/22
to lavaan
Hi,

I think the default approach in sam() is to use separate measurement blocks for each latent variable. This is not the case when using sem and this could explain the problem. I think it works when you define the measurement blocks (one for visuals and one for textual and speed together) using the mm.list argument. See code below:

sam_fit <- sam(HS.model, data = HolzingerSwineford1939, mm.list = list("visual", c("textual", "speed")))
lavInspect(sam_fit, what = "est")


Best wishes, 

Jasper
Op woensdag 2 november 2022 om 12:30:01 UTC+1 schreef Manuel Rein:

Manuel Rein

unread,
Nov 2, 2022, 9:47:06 AM11/2/22
to lavaan
Hi Jasper,

thank you very much, this helped!

Best
Manuel

Reply all
Reply to author
Forward
0 new messages