After confirming metric and scalar invariance, I want to compare groups based on their factor means, i.e., I want to get factor means for each group. How do I do this in lavaan?I think I need to set the latent factor mean to 0 in one group and allow it to vary in the other(s), but I'm not sure how to do this.
--
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.
To post to this group, send email to lav...@googlegroups.com.
Visit this group at https://groups.google.com/group/lavaan.
To view this discussion on the web visit https://groups.google.com/d/msgid/lavaan/236e537d-8be2-41ce-b8bb-06db0432bc66%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi Brandon,There are several ways you could do this with lavaan. But I would recommend using effects coding as described here: http://www.agencylab.ku.edu/~agencylab/manuscripts/(Little,%20Slegers,%20Card,%202006).pdfI have an R script available here: https://github.com/cddesja/lavaan-reproducible/blob/master/little2006-scaling.RThat does the effects coding in that paper (go to line 221). That way you will estimate the means for each group.You could also do a simple contrast, as you've described, which is the default way lavaan does this (I believe), by setting one group as the reference group.Chris
On Mon, May 13, 2019 at 7:15 PM Brandon Bretl <bre...@gmail.com> wrote:
After confirming metric and scalar invariance, I want to compare groups based on their factor means, i.e., I want to get factor means for each group. How do I do this in lavaan?--I think I need to set the latent factor mean to 0 in one group and allow it to vary in the other(s), but I'm not sure how to do this.
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 lav...@googlegroups.com.
Doesn’t this do what you want?
HS.model <- ' visual =~ x1 + x2 + x3
textual =~ x4 + x5 + x6
speed =~ x7 + x8 + x9 '
fit <- cfa(HS.model,
data = HolzingerSwineford1939,
group.equal = c("loadings", "intercepts"),
group = "school")
summary(fit)
You’ll notice Pasteur is the reference group and Grant-White is the focal group and that Pastuer’s means are zeroes on the factors, while Grant-White’s means are estimated and correspond to the difference between the two schools (i.e., Grant is higher on textual, lower on speed, and there is no difference on visual if you use a cutoff of .05).
Chris
To unsubscribe from this group and stop receiving emails from it, send an email to lavaan+un...@googlegroups.com.
To post to this group, send email to lav...@googlegroups.com.
Visit this group at https://groups.google.com/group/lavaan.
To view this discussion on the web visit https://groups.google.com/d/msgid/lavaan/ea6f6dbb-ebe3-40c6-8711-134e09d4295d%40googlegroups.com.
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all
cpa 0.346 0.042 8.245 0.000 0.717 0.717 cph 0.436 0.058 7.545 0.000 0.682 0.682 ce 0.125 0.023 5.349 0.000 0.365 0.365 just 0.148 0.040 3.698 0.000 0.273 0.273 lib 0.023 0.040 0.587 0.557 0.039 0.039 auth 0.212 0.033 6.391 0.000 0.415 0.415 loya 0.090 0.031 2.912 0.004 0.195 0.195 sanc 0.209 0.047 4.470 0.000 0.380 0.380
YES! I think that's it. So now I'm looking at the intercepts as the means. So there is significant difference between groups in all my factor means except "lib" (liberty). Thanks!
To unsubscribe from this group and stop receiving emails from it, send an email to lavaan+un...@googlegroups.com.
To post to this group, send email to lav...@googlegroups.com.
Visit this group at https://groups.google.com/group/lavaan.
To view this discussion on the web visit https://groups.google.com/d/msgid/lavaan/6dae1f1f-5674-48cf-b848-a379ef3031e4%40googlegroups.com.
I need to set the latent factor mean to 0 in one group and allow it to vary in the other(s), but I'm not sure how to do this.
x1 ~ c(int1, int1)*1 # restrict indicator intercepts across groups
x2 ~ c(int2, int2)*1
...
factor ~ c(0, NA)*1 # free second group's latent mean