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 @@

7.4 In-Class Exercises7.4.1 Measurement Invariance


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 @@

7.4.1 Measurement Invariance

7.4.1.1

-

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.

@@ -896,6 +896,12 @@

7.4.1.2

  • The model comparison test shows a non-significant loss of fit between the weak and strong models (\(\Delta \chi^2[4] = 4.69\), \(p = 0.32\)).
  • +
  • The strongly invariant model still fits the data well +(\(\chi^2[18] = 23.97\), +\(p = 0.156\), +\(\textit{RMSEA} = 0.034\), +\(\textit{CFI} = 0.992\), +\(\textit{SRMR} = 0.042\)).
@@ -1036,11 +1042,12 @@

7.4.2.1

Click for explanation -

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.


@@ -1065,7 +1072,7 @@

7.4.3.1


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.


@@ -1532,45 +1539,11 @@

7.4.3.2

## df rmsea cfi tli srmr aic bic ## weak - config 6 -0.009 0.005 0.010 0.003 -10.008 -31.136 ## strong - weak 6 -0.006 0.003 0.006 0.001 -8.507 -29.635 -
## 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
Click for explanation -

Yes, we have been able to establish full measurement invariance.

+

Yes, we can establish full measurement invariance.

  • Configural invariance holds.
      @@ -1591,11 +1564,11 @@

      7.4.3.2

    • The model comparison test shows a non-significant loss of fit between the weak and strong models (\(\Delta \chi^2[6] = 3.49\), \(p = 0.745\)).
    • The strongly invariant model still fits the data well -(\(\chi^2[48] = 66.56\), -\(p = 0.039\), -\(\textit{RMSEA} = 0.056\), -\(\textit{CFI} = 0.979\), -\(\textit{SRMR} = 0.048\)).
    • +(\(\chi^2[60] = 72.05\), +\(p = 0.137\), +\(\textit{RMSEA} = 0.04\), +\(\textit{CFI} = 0.986\), +\(\textit{SRMR} = 0.051\)).
@@ -1617,21 +1590,21 @@

7.4.3.3

Click to show code -
## Add the structural paths to the model:
-tora_sem <- paste(tora_cfa,
-                  'intent ~ attitudes + norms
-                   behavior ~ intent + control',
-                  sep = '\n')
-
-## Estimate the model:
-toraOut <- sem(tora_sem, 
-               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:
+tora_sem <- paste(tora_cfa,
+                  'intent ~ attitudes + norms
+                   behavior ~ intent + control',
+                  sep = '\n')
+
+## Estimate the model:
+toraOut <- sem(tora_sem, 
+               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.
-toraOut0 <- sem(tora_sem, 
-                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.
+toraOut0 <- sem(tora_sem, 
+                data = condom, 
+                group = "sex", 
+                group.equal = c("loadings", "intercepts", "regressions")
+                )
+
+## Test the constraints:
+anova(toraOut, toraOut0)