Means comparison in Lavaan

1,025 views
Skip to first unread message

Anna Jakovleva

unread,
Apr 23, 2014, 10:32:14 AM4/23/14
to lav...@googlegroups.com
Hello,
I am calculating a moderated meditation with a multiple group model in lavaan for R. 
My delta Chi-square statistics suggest that there are differences in path coefficients and covariances between the groups. However, I also would like to know how the groups differ, which group has the highest and which the lowest value on the "ENG" variable.
Is there any possibility in lavaan to compute mean differences of groups on a latent variable and their significance (comparable to the anova function in R)?

Here is my model structure and the model definition with a grouping variable: 

mod.mediation<-'
ENG=~Q11_1R+Q11_2R+Q11_3R+Q11_4R+Q11_5R
roleload=~Q12_1+Q12_2R+Q12_3R+Q12_4R+Q12_5R+Q12_6R+Q12_7R+Q12_8R 
leadersup=~Q8_1R+Q8_2R+Q8_4R+Q8_5R+Q8_8R
colcoop=~Q9_3R+Q9_4R+Q9_6R+Q9_9R

Q43_MDI ~ c_r*roleload
Q43_MDI ~ c_l*leadersup
Q43_MDI ~ c_c*colcoop

Q43_MDI ~ b_D*ENG

ENG ~ a_r*roleload
ENG ~ a_l*leadersup
ENG ~ a_c*colcoop

#variances
Q43_MDI ~~ Q43_MDI
ENG ~~ ENG

#indirect effect
#ab := a*b

ind1D := a_r*b_D
ind2D := a_l*b_D
ind3D := a_c*b_D

#total effect
#tot := c + (a*b)

tot_roleload := c_r + (a_r*b_D)
tot_leadersup := c_l + (a_l*b_D)
tot_colcoop := c_c + (a_c*b_D)
'
levels(ah$Tenure)
1="early"  2="middle" 3="late" 
contr.treatment(3, base=1)

fit_u <- sem(mod.mediation, data=ah, std.lv=TRUE, group="Tenure", group.equal=c("loadings"),group.partial=c("roleload=~Q12_2R","roleload=~Q12_3R", "roleload=~Q12_4R"),estimator="WLSM")

I would appreciate your answer! Thank you for answering the forum comments, I would not have gotten that far without them. : )

yrosseel

unread,
May 7, 2014, 1:45:16 PM5/7/14
to lav...@googlegroups.com
On 04/23/2014 04:32 PM, Anna Jakovleva wrote:
> Is there any possibility in lavaan to compute mean differences of groups
> on a latent variable and their significance (comparable to the anova
> function in R)?

Well, first you need to establish measurement invariance. But suppose
you have measurement invariance, you need to constrain the factor
loadings AND intercepts to be equal (I am assuming all indicators are
continuous), by using group.equal=c("loadings", "intercepts").

Then, by default, the factor means of the first group will be fixed to
zero (=reference group), but the other factor means are estimated, and
can be interpreted as the difference between those groups and the
reference groups. And you get a significance test.

Yves.

Reply all
Reply to author
Forward
0 new messages