diff --git a/docs/in-class-exercises-6.html b/docs/in-class-exercises-6.html index 32724d4..09c5baf 100644 --- a/docs/in-class-exercises-6.html +++ b/docs/in-class-exercises-6.html @@ -477,7 +477,7 @@
We’ll now pick up where we left off with the At-Home Exercises -by testing measurement invariance in the two-group CFA of prolonged grief disorder.
+by testing measurement invariance in the two-group CFA from 7.3.2.4.As you saw in the lecture, measurement invariance testing allows us to empirically test for differences in the measurement model between the groups. If we can establish measurement invariance, we can draw the following (equivalent) @@ -510,9 +510,9 @@
Load the PGDdata2.txt data as you did for the At-Home Exercises.
+Load the PGDdata2.txt data as you did for the At-Home Exercises.
We can equate the latent means by specifying the group.equal = "means"
argument
-in cfa()
. Then, we simply test this constrained model against the strong
-invariance model to get our test of mean differences.
We can equate the latent means by specifying the group.equal = "means"
+argument in cfa()
. Then, we simply compare this constrained model to the
+strong invariance model to get our test of mean differences.
In this case, the means of the grief
factor do not significantly differ between
-Kin2
groups (\(\Delta \chi^2[1] = 3.65\), \(p = 0.056\)).
Kin2
groups (\(\Delta \chi^2[1] = 3.65\), \(p = 0.056\)), assuming we
+adopt an alpha-level of 0.05 or lower for the test.
Before we get to any moderation tests, however, we first need to establish measurement invariance. The first step in any multiple-group analysis that -includes latent variables is measurment invariance testing.
+includes latent variables is measurement invariance testing.## Make sure the strongly invariant model still fits well in an absolute sense:
-fitMeasures(strong)
## npar fmin chisq
-## 48.000 0.144 72.050
-## df pvalue baseline.chisq
-## 60.000 0.137 948.362
-## baseline.df baseline.pvalue cfi
-## 72.000 0.000 0.986
-## tli nnfi rfi
-## 0.983 0.983 0.909
-## nfi pnfi ifi
-## 0.924 0.770 0.986
-## rni logl unrestricted.logl
-## 0.986 -2953.481 -2917.456
-## aic bic ntotal
-## 6002.962 6171.992 250.000
-## bic2 rmsea rmsea.ci.lower
-## 6019.828 0.040 0.000
-## rmsea.ci.upper rmsea.ci.level rmsea.pvalue
-## 0.071 0.900 0.669
-## rmsea.close.h0 rmsea.notclose.pvalue rmsea.notclose.h0
-## 0.050 0.013 0.080
-## rmr rmr_nomean srmr
-## 0.062 0.067 0.051
-## srmr_bentler srmr_bentler_nomean crmr
-## 0.051 0.055 0.054
-## crmr_nomean srmr_mplus srmr_mplus_nomean
-## 0.059 0.052 0.054
-## cn_05 cn_01 gfi
-## 275.398 307.658 0.997
-## agfi pgfi mfi
-## 0.994 0.554 0.976
-## ecvi
-## 0.672
Yes, we have been able to establish full measurement invariance.
+Yes, we can establish full measurement invariance.
## Add the structural paths to the model:
-<- paste(tora_cfa,
- tora_sem 'intent ~ attitudes + norms
- behavior ~ intent + control',
-sep = '\n')
-
-## Estimate the model:
-<- sem(tora_sem,
- toraOut data = condom,
- group = "sex",
- group.equal = c("loadings", "intercepts")
-
- )
-## Check the results:
-summary(toraOut, fit.measures = TRUE, standardized = TRUE, rsquare = TRUE)
## Add the structural paths to the model:
+<- paste(tora_cfa,
+ tora_sem 'intent ~ attitudes + norms
+ behavior ~ intent + control',
+sep = '\n')
+
+## Estimate the model:
+<- sem(tora_sem,
+ toraOut data = condom,
+ group = "sex",
+ group.equal = c("loadings", "intercepts")
+
+ )
+## Check the results:
+summary(toraOut, fit.measures = TRUE, standardized = TRUE, rsquare = TRUE)
## lavaan 0.6.16 ended normally after 62 iterations
##
## Estimator ML
@@ -1866,16 +1839,16 @@ 7.4.3.4
Click for explanation
-## Estimate a restricted model wherein the latent regressions are all equated
-## across groups.
-<- sem(tora_sem,
- toraOut0 data = condom,
- group = "sex",
- group.equal = c("loadings", "intercepts", "regressions")
-
- )
-## Test the constraints:
-anova(toraOut, toraOut0)
+## Estimate a restricted model wherein all latent regression paths are equated
+## across groups.
+<- sem(tora_sem,
+ toraOut0 data = condom,
+ group = "sex",
+ group.equal = c("loadings", "intercepts", "regressions")
+
+ )
+## Test the constraints:
+anova(toraOut, toraOut0)