I am trying to compare two groups of children and test whether executive function (EF) is a significant predictor of reasoning (CR) (and I also include other covariates) using SEM and the lavaan package in R.
- Am I correctly doing that comparison with this code?
- How do I interpret the lengthy output?
- Is the only way to compare whether or not the regression coefficients are significantly different between groups is to compare two models with and without constraining the regressions to be equal?
Attempt 1:
mod1= '
CR =~ v1 + v2
EF =~ ef1 + ef2 + ef3 + ef4 + ef5
CR ~ c(a1, a2)*v3 + c(b1,b2)*v4 + c(c1,c2)*v5 + c(d1, d2)*EF
diff.a1a2 := a1 - a2
diff.b1b2 := b1 - b2
diff.c1c2 := c1 - c2
diff.d1d2 := d1 - d2 '
fitnew<- sem(mod1, data=datamicescaled,
std.lv =T, group = "age.group",estimator = "MLR", missing = "fiml")
summary(fitnew, fit.measures=TRUE, standardized=TRUE)
Output 1:
Defined Parameters:
Estimate Std.Err z-value P(>|z|) Std.lv Std.all
diff.a1a2 -0.049 0.509 -0.095 0.924 -0.063 -0.170
diff.b1b2 0.948 4.497 0.211 0.833 0.020 0.026
diff.c1c2 1.023 2.425 0.422 0.673 0.250 0.293
diff.d1d2 0.945 4.823 0.196 0.845 0.070 0.070
Attempt 2:
mod2= '
CR =~ v1 + v2 + v3
EF =~ ef1 + ef2 + ef3 + ef4 + ef5
CR ~ v4 + v5 + v6 + EF '
fit2<- sem(mod2, data=datamicescaled,
std.lv =T, group = "age.group",estimator = "MLR", missing = "fiml", group.equal = c"regressions)
summary(fit2, fit.measures=TRUE, standardized=TRUE)
Thank you in advance for any help. I have been talking myself into circles all day, and I would really appreciate any input!