if (!require(lavaan)) install.packages("lavaan")
Loading required package: lavaan
This is lavaan 0.5-23.1097
lavaan is BETA software! Please report any bugs.
library(lavaan)

Longitudinal Invariance CFA (using MLR) Example in lavaan (N = 151; 6 items over 3 occasions)

These data measuring a latent trait of social functioning were collected at a Psychiatric Rehabilitation center, in which time 1 was admittance, and times 2 and 3 were collected at six-month intervals. There were six subscales that were completed by the hospital staff for each patient, including positively-oriented measures of Social Competence, Social Interest, and Personal Neatness, and negatively-oriented measures of Psychoticism, Motor Retardation, and Irritability. The negatively-oriented subscales were reflected (*−1) prior to analysis. Initial models examined the fit of one-factor versus two-factor models given the two valences of the subscales, but the fit of the two-factor model was not a significant improvement, and thus a one-factor model with all six items was used here.

#read in data
cafData = read.table(file = "CAF.dat", header = FALSE, na.strings = "9999")
names(cafData) = c("ID", "v1T1", "v1T2", "v1T3", "v2T1", "v2T2", "v2T3", "v3T1", "v3T2", "v3T3", "v4T1", "v4T2", "v4T3", "v5T1", "v5T2", "v5T3", "v6T1", "v6T2", "v6T3")
#recode negatively worded items
cafData$v4T1 = cafData$v4T1*(-1); cafData$v4T2 = cafData$v4T2*(-1); cafData$v4T3 = cafData$v4T3*(-1);
cafData$v5T1 = cafData$v5T1*(-1); cafData$v5T2 = cafData$v5T2*(-1); cafData$v5T3 = cafData$v5T3*(-1);
cafData$v6T1 = cafData$v6T1*(-1); cafData$v6T2 = cafData$v6T2*(-1); cafData$v6T3 = cafData$v6T3*(-1);

1. Configural Longitudinal Invariance Model (everything separate across time)

Note: as groups are not defined in our data, we will not be using the the multiple group syntax in lavaan. Instead, we will build our code where the three factors are the three groups.

configuralSyntax = "
#===================================================================================================
#Factor loadings all freely estimated in each group with labels
Time1 =~ L1T1*v1T1 + L2T1*v2T1 + L3T1*v3T1 + L4T1*v4T1 + L5T1*v5T1 + L6T1*v6T1
Time2 =~ L1T2*v1T2 + L2T2*v2T2 + L3T2*v3T2 + L4T2*v4T2 + L5T2*v5T2 + L6T2*v6T2
Time3 =~ L1T3*v1T3 + L2T3*v2T3 + L3T3*v3T3 + L4T3*v4T3 + L5T3*v5T3 + L6T3*v6T3
#===================================================================================================
#Item intercepts all freely estimated in each group with labels
v1T1 ~ I1T1*1; v2T1 ~ I2T1*1;  v3T1 ~ I3T1*1; v4T1 ~ I4T1*1; v5T1 ~ I5T1*1; v6T1 ~ I6T1*1; 
v1T2 ~ I1T2*1; v2T2 ~ I2T2*1;  v3T2 ~ I3T2*1; v4T2 ~ I4T2*1; v5T2 ~ I5T2*1; v6T2 ~ I6T2*1; 
v1T3 ~ I1T3*1; v2T3 ~ I2T3*1;  v3T3 ~ I3T3*1; v4T3 ~ I4T3*1; v5T3 ~ I5T3*1; v6T3 ~ I6T3*1; 
#===================================================================================================
#Redidual variances all freely estimated in each group with labels
v1T1 ~~ E1T1*v1T1; v2T1 ~~ E2T1*v2T1;  v3T1 ~~ E3T1*v3T1; v4T1 ~~ E4T1*v4T1; v5T1 ~~ E5T1*v5T1; v6T1 ~~ E6T1*v6T1;
v1T2 ~~ E1T2*v1T2; v2T2 ~~ E2T2*v2T2;  v3T2 ~~ E3T2*v3T2; v4T2 ~~ E4T2*v4T2; v5T2 ~~ E5T2*v5T2; v6T2 ~~ E6T2*v6T2;
v1T3 ~~ E1T3*v1T3; v2T3 ~~ E2T3*v2T3;  v3T3 ~~ E3T3*v3T3; v4T3 ~~ E4T3*v4T3; v5T3 ~~ E5T3*v5T3; v6T3 ~~ E6T3*v6T3;
#===================================================================================================
#Residual covariances freely estimated in each group with labels
v1T1 ~~ C1T12*v1T2 + C1T13*v1T3; v1T2 ~~ C1T23*v1T3; 
v2T1 ~~ C2T12*v2T2 + C2T13*v2T3; v2T2 ~~ C2T23*v2T3; 
v3T1 ~~ C3T12*v3T2 + C3T13*v3T3; v3T2 ~~ C3T23*v3T3; 
v4T1 ~~ C4T12*v4T2 + C4T13*v4T3; v4T2 ~~ C4T23*v4T3; 
v5T1 ~~ C5T12*v5T2 + C5T13*v5T3; v5T2 ~~ C5T23*v5T3; 
v6T1 ~~ C6T12*v6T2 + C6T13*v6T3; v6T2 ~~ C6T23*v6T3; 
#===================================================================================================
#Factor variance fixed to 1 for identification in each group
Time1 ~~ 1*Time1
Time2 ~~ 1*Time2
Time3 ~~ 1*Time3
#===================================================================================================
#Factor mean fixed to zero for identification in each group
Time1 ~ 0
Time2 ~ 0
Time3 ~ 0
#===================================================================================================
#Factor covariances all freely estimated
Time1 ~~ Time2 + Time3
Time2 ~~ Time3 
#===================================================================================================
"
configuralEstimates = lavaan(model = configuralSyntax, data = cafData, estimator = "MLR", mimic = "mplus")
lavaan WARNING: some cases are empty and will be ignored:
  16 58 64 75 76 133 153 156
summary(configuralEstimates, fit.measures = TRUE, rsquare = TRUE, standardized = TRUE)
lavaan (0.5-23.1097) converged normally after 118 iterations

                                                  Used       Total
  Number of observations                           151         159

  Number of missing patterns                         7

  Estimator                                         ML      Robust
  Minimum Function Test Statistic              292.514     283.247
  Degrees of freedom                               114         114
  P-value (Chi-square)                           0.000       0.000
  Scaling correction factor                                  1.033
    for the Yuan-Bentler correction (Mplus variant)

Model test baseline model:

  Minimum Function Test Statistic             2192.158    1896.786
  Degrees of freedom                               153         153
  P-value                                        0.000       0.000

User model versus baseline model:

  Comparative Fit Index (CFI)                    0.912       0.903
  Tucker-Lewis Index (TLI)                       0.883       0.870

  Robust Comparative Fit Index (CFI)                         0.913
  Robust Tucker-Lewis Index (TLI)                            0.884

Loglikelihood and Information Criteria:

  Loglikelihood user model (H0)              -4430.302   -4430.302
  Scaling correction factor                                  1.462
    for the MLR correction
  Loglikelihood unrestricted model (H1)      -4284.045   -4284.045
  Scaling correction factor                                  1.203
    for the MLR correction

  Number of free parameters                         75          75
  Akaike (AIC)                                9010.604    9010.604
  Bayesian (BIC)                              9236.900    9236.900
  Sample-size adjusted Bayesian (BIC)         8999.533    8999.533

Root Mean Square Error of Approximation:

  RMSEA                                          0.102       0.099
  90 Percent Confidence Interval          0.088  0.116       0.085  0.113
  P-value RMSEA <= 0.05                          0.000       0.000

  Robust RMSEA                                               0.101
  90 Percent Confidence Interval                             0.086  0.116

Standardized Root Mean Square Residual:

  SRMR                                           0.089       0.089

Parameter Estimates:

  Information                                 Observed
  Standard Errors                   Robust.huber.white

Latent Variables:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  Time1 =~                                                              
    v1T1    (L1T1)    3.222    0.267   12.063    0.000    3.222    0.989
    v2T1    (L2T1)    1.915    0.274    6.997    0.000    1.915    0.545
    v3T1    (L3T1)    2.080    0.209    9.956    0.000    2.080    0.801
    v4T1    (L4T1)    1.975    0.271    7.298    0.000    1.975    0.593
    v5T1    (L5T1)    0.931    0.148    6.281    0.000    0.931    0.568
    v6T1    (L6T1)    1.441    0.119   12.101    0.000    1.441    0.742
  Time2 =~                                                              
    v1T2    (L1T2)    2.863    0.305    9.372    0.000    2.863    0.970
    v2T2    (L2T2)    2.072    0.197   10.490    0.000    2.072    0.649
    v3T2    (L3T2)    2.133    0.185   11.509    0.000    2.133    0.821
    v4T2    (L4T2)    2.098    0.322    6.514    0.000    2.098    0.628
    v5T2    (L5T2)    1.175    0.239    4.921    0.000    1.175    0.477
    v6T2    (L6T2)    1.512    0.129   11.749    0.000    1.512    0.821
  Time3 =~                                                              
    v1T3    (L1T3)    2.550    0.288    8.865    0.000    2.550    0.962
    v2T3    (L2T3)    1.961    0.230    8.539    0.000    1.961    0.654
    v3T3    (L3T3)    1.751    0.210    8.323    0.000    1.751    0.750
    v4T3    (L4T3)    1.678    0.260    6.448    0.000    1.678    0.551
    v5T3    (L5T3)    1.021    0.170    6.012    0.000    1.021    0.511
    v6T3    (L6T3)    1.523    0.159    9.574    0.000    1.523    0.869

Covariances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
 .v1T1 ~~                                                               
   .v1T2   (C1T12)   -0.214    0.250   -0.855    0.393   -0.214   -0.609
   .v1T3   (C1T13)   -0.004    0.247   -0.016    0.987   -0.004   -0.011
 .v1T2 ~~                                                               
   .v1T3    (C1T2)    0.113    0.231    0.488    0.626    0.113    0.218
 .v2T1 ~~                                                               
   .v2T2   (C2T12)    3.949    0.682    5.787    0.000    3.949    0.552
   .v2T3   (C2T13)    2.256    0.805    2.803    0.005    2.256    0.338
 .v2T2 ~~                                                               
   .v2T3    (C2T2)    2.154    0.580    3.718    0.000    2.154    0.391
 .v3T1 ~~                                                               
   .v3T2   (C3T12)    0.965    0.289    3.340    0.001    0.965    0.419
   .v3T3   (C3T13)    1.172    0.284    4.135    0.000    1.172    0.489
 .v3T2 ~~                                                               
   .v3T3    (C3T2)    1.241    0.316    3.931    0.000    1.241    0.542
 .v4T1 ~~                                                               
   .v4T2   (C4T12)    4.853    0.863    5.623    0.000    4.853    0.695
   .v4T3   (C4T13)    3.801    1.033    3.679    0.000    3.801    0.557
 .v4T2 ~~                                                               
   .v4T3    (C4T2)    4.588    0.821    5.592    0.000    4.588    0.694
 .v5T1 ~~                                                               
   .v5T2   (C5T12)    2.349    0.767    3.064    0.002    2.349    0.804
   .v5T3   (C5T13)    1.429    0.441    3.243    0.001    1.429    0.617
 .v5T2 ~~                                                               
   .v5T3    (C5T2)    2.887    0.777    3.717    0.000    2.887    0.778
 .v6T1 ~~                                                               
   .v6T2   (C6T12)    0.824    0.162    5.096    0.000    0.824    0.603
   .v6T3   (C6T13)    0.592    0.182    3.251    0.001    0.592    0.525
 .v6T2 ~~                                                               
   .v6T3    (C6T2)    0.547    0.140    3.910    0.000    0.547    0.601
  Time1 ~~                                                              
    Time2             0.786    0.042   18.827    0.000    0.786    0.786
    Time3             0.707    0.084    8.456    0.000    0.707    0.707
  Time2 ~~                                                              
    Time3             0.671    0.089    7.532    0.000    0.671    0.671

Intercepts:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .v1T1    (I1T1)   16.077    0.276   58.220    0.000   16.077    4.933
   .v2T1    (I2T1)    8.672    0.298   29.132    0.000    8.672    2.469
   .v3T1    (I3T1)   11.970    0.225   53.108    0.000   11.970    4.611
   .v4T1    (I4T1)   -3.037    0.271  -11.216    0.000   -3.037   -0.912
   .v5T1    (I5T1)   -1.283    0.138   -9.293    0.000   -1.283   -0.782
   .v6T1    (I6T1)   -2.871    0.164  -17.508    0.000   -2.871   -1.478
   .v1T2    (I1T2)   17.226    0.245   70.294    0.000   17.226    5.837
   .v2T2    (I2T2)    9.981    0.263   37.921    0.000    9.981    3.124
   .v3T2    (I3T2)   12.467    0.218   57.265    0.000   12.467    4.799
   .v4T2    (I4T2)   -3.211    0.260  -12.349    0.000   -3.211   -0.961
   .v5T2    (I5T2)   -1.664    0.200   -8.338    0.000   -1.664   -0.676
   .v6T2    (I6T2)   -2.413    0.158  -15.316    0.000   -2.413   -1.311
   .v1T3    (I1T3)   17.756    0.220   80.621    0.000   17.756    6.699
   .v2T3    (I2T3)   10.442    0.281   37.204    0.000   10.442    3.483
   .v3T3    (I3T3)   13.029    0.213   61.157    0.000   13.029    5.583
   .v4T3    (I4T3)   -2.738    0.249  -11.014    0.000   -2.738   -0.899
   .v5T3    (I5T3)   -1.247    0.166   -7.511    0.000   -1.247   -0.625
   .v6T3    (I6T3)   -2.075    0.152  -13.618    0.000   -2.075   -1.184
    Time1             0.000                               0.000    0.000
    Time2             0.000                               0.000    0.000
    Time3             0.000                               0.000    0.000

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .v1T1    (E1T1)    0.241    0.395    0.610    0.542    0.241    0.023
   .v2T1    (E2T1)    8.672    1.022    8.484    0.000    8.672    0.703
   .v3T1    (E3T1)    2.413    0.398    6.067    0.000    2.413    0.358
   .v4T1    (E4T1)    7.199    1.036    6.950    0.000    7.199    0.649
   .v5T1    (E5T1)    1.824    0.446    4.093    0.000    1.824    0.678
   .v6T1    (E6T1)    1.694    0.243    6.974    0.000    1.694    0.449
   .v1T2    (E1T2)    0.511    0.268    1.907    0.056    0.511    0.059
   .v2T2    (E2T2)    5.913    0.617    9.581    0.000    5.913    0.579
   .v3T2    (E3T2)    2.202    0.369    5.972    0.000    2.202    0.326
   .v4T2    (E4T2)    6.765    0.990    6.834    0.000    6.765    0.606
   .v5T2    (E5T2)    4.676    1.439    3.251    0.001    4.676    0.772
   .v6T2    (E6T2)    1.103    0.166    6.643    0.000    1.103    0.326
   .v1T3    (E1T3)    0.523    0.349    1.497    0.134    0.523    0.074
   .v2T3    (E2T3)    5.142    0.806    6.379    0.000    5.142    0.572
   .v3T3    (E3T3)    2.381    0.430    5.542    0.000    2.381    0.437
   .v4T3    (E4T3)    6.456    1.078    5.988    0.000    6.456    0.696
   .v5T3    (E5T3)    2.944    0.752    3.913    0.000    2.944    0.739
   .v6T3    (E6T3)    0.751    0.162    4.630    0.000    0.751    0.244
    Time1             1.000                               1.000    1.000
    Time2             1.000                               1.000    1.000
    Time3             1.000                               1.000    1.000

R-Square:
                   Estimate
    v1T1              0.977
    v2T1              0.297
    v3T1              0.642
    v4T1              0.351
    v5T1              0.322
    v6T1              0.551
    v1T2              0.941
    v2T2              0.421
    v3T2              0.674
    v4T2              0.394
    v5T2              0.228
    v6T2              0.674
    v1T3              0.926
    v2T3              0.428
    v3T3              0.563
    v4T3              0.304
    v5T3              0.261
    v6T3              0.756

Although the fit is not great, attempts to improve it logically were unsuccessful, so we proceed from here with this as the configural invariance model. This foreshadows the metric invariance section up next.

2. Metric Invariance Models (ALL loadings held equal across time - identified model using Time1 Factor Variance = 1)

metricSyntax1 = "
#===================================================================================================
#Factor loadings all constrained across groups with labels *****
Time1 =~ L1*v1T1 + L2*v2T1 + L3*v3T1 + L4*v4T1 + L5*v5T1 + L6*v6T1
Time2 =~ L1*v1T2 + L2*v2T2 + L3*v3T2 + L4*v4T2 + L5*v5T2 + L6*v6T2
Time3 =~ L1*v1T3 + L2*v2T3 + L3*v3T3 + L4*v4T3 + L5*v5T3 + L6*v6T3
#===================================================================================================
#Item intercepts all freely estimated in each group with labels
v1T1 ~ I1T1*1; v2T1 ~ I2T1*1;  v3T1 ~ I3T1*1; v4T1 ~ I4T1*1; v5T1 ~ I5T1*1; v6T1 ~ I6T1*1; 
v1T2 ~ I1T2*1; v2T2 ~ I2T2*1;  v3T2 ~ I3T2*1; v4T2 ~ I4T2*1; v5T2 ~ I5T2*1; v6T2 ~ I6T2*1; 
v1T3 ~ I1T3*1; v2T3 ~ I2T3*1;  v3T3 ~ I3T3*1; v4T3 ~ I4T3*1; v5T3 ~ I5T3*1; v6T3 ~ I6T3*1; 
#===================================================================================================
#Redidual variances all freely estimated in each group with labels
v1T1 ~~ E1T1*v1T1; v2T1 ~~ E2T1*v2T1;  v3T1 ~~ E3T1*v3T1; v4T1 ~~ E4T1*v4T1; v5T1 ~~ E5T1*v5T1; v6T1 ~~ E6T1*v6T1;
v1T2 ~~ E1T2*v1T2; v2T2 ~~ E2T2*v2T2;  v3T2 ~~ E3T2*v3T2; v4T2 ~~ E4T2*v4T2; v5T2 ~~ E5T2*v5T2; v6T2 ~~ E6T2*v6T2;
v1T3 ~~ E1T3*v1T3; v2T3 ~~ E2T3*v2T3;  v3T3 ~~ E3T3*v3T3; v4T3 ~~ E4T3*v4T3; v5T3 ~~ E5T3*v5T3; v6T3 ~~ E6T3*v6T3;
#===================================================================================================
#Residual covariances freely estimated in each group with labels
v1T1 ~~ C1T12*v1T2 + C1T13*v1T3; v1T2 ~~ C1T23*v1T3; 
v2T1 ~~ C2T12*v2T2 + C2T13*v2T3; v2T2 ~~ C2T23*v2T3; 
v3T1 ~~ C3T12*v3T2 + C3T13*v3T3; v3T2 ~~ C3T23*v3T3; 
v4T1 ~~ C4T12*v4T2 + C4T13*v4T3; v4T2 ~~ C4T23*v4T3; 
v5T1 ~~ C5T12*v5T2 + C5T13*v5T3; v5T2 ~~ C5T23*v5T3; 
v6T1 ~~ C6T12*v6T2 + C6T13*v6T3; v6T2 ~~ C6T23*v6T3;  
#===================================================================================================
#Factor variance fixed to 1 for identification in first group; estimated in others *****
Time1 ~~ 1*Time1
Time2 ~~ Time2
Time3 ~~ Time3
#===================================================================================================
#Factor mean fixed to zero for identification in each group
Time1 ~ 0
Time2 ~ 0
Time3 ~ 0
#===================================================================================================
#Factor covariances all freely estimated
Time1 ~~ Time2 + Time3
Time2 ~~ Time3 
#===================================================================================================
"
metricEstimates1 = lavaan(model = metricSyntax1, data = cafData, estimator = "MLR", mimic = "mplus")
lavaan WARNING: some cases are empty and will be ignored:
  16 58 64 75 76 133 153 156
summary(metricEstimates1, fit.measures = TRUE, rsquare = TRUE, standardized = TRUE)
lavaan (0.5-23.1097) converged normally after 120 iterations

                                                  Used       Total
  Number of observations                           151         159

  Number of missing patterns                         7

  Estimator                                         ML      Robust
  Minimum Function Test Statistic              316.712     301.234
  Degrees of freedom                               124         124
  P-value (Chi-square)                           0.000       0.000
  Scaling correction factor                                  1.051
    for the Yuan-Bentler correction (Mplus variant)

Model test baseline model:

  Minimum Function Test Statistic             2192.158    1896.786
  Degrees of freedom                               153         153
  P-value                                        0.000       0.000

User model versus baseline model:

  Comparative Fit Index (CFI)                    0.905       0.898
  Tucker-Lewis Index (TLI)                       0.883       0.875

  Robust Comparative Fit Index (CFI)                         0.908
  Robust Tucker-Lewis Index (TLI)                            0.886

Loglikelihood and Information Criteria:

  Loglikelihood user model (H0)              -4442.401   -4442.401
  Scaling correction factor                                  1.260
    for the MLR correction
  Loglikelihood unrestricted model (H1)      -4284.045   -4284.045
  Scaling correction factor                                  1.203
    for the MLR correction

  Number of free parameters                         65          65
  Akaike (AIC)                                9014.803    9014.803
  Bayesian (BIC)                              9210.926    9210.926
  Sample-size adjusted Bayesian (BIC)         9005.208    9005.208

Root Mean Square Error of Approximation:

  RMSEA                                          0.101       0.097
  90 Percent Confidence Interval          0.088  0.115       0.084  0.111
  P-value RMSEA <= 0.05                          0.000       0.000

  Robust RMSEA                                               0.100
  90 Percent Confidence Interval                             0.085  0.114

Standardized Root Mean Square Residual:

  SRMR                                           0.094       0.094

Parameter Estimates:

  Information                                 Observed
  Standard Errors                   Robust.huber.white

Latent Variables:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  Time1 =~                                                              
    v1T1      (L1)    3.004    0.249   12.073    0.000    3.004    0.962
    v2T1      (L2)    2.117    0.204   10.365    0.000    2.117    0.588
    v3T1      (L3)    2.139    0.200   10.699    0.000    2.139    0.822
    v4T1      (L4)    2.018    0.256    7.873    0.000    2.018    0.599
    v5T1      (L5)    0.981    0.147    6.659    0.000    0.981    0.588
    v6T1      (L6)    1.611    0.125   12.865    0.000    1.611    0.783
  Time2 =~                                                              
    v1T2      (L1)    3.004    0.249   12.073    0.000    2.938    0.975
    v2T2      (L2)    2.117    0.204   10.365    0.000    2.070    0.647
    v3T2      (L3)    2.139    0.200   10.699    0.000    2.091    0.814
    v4T2      (L4)    2.018    0.256    7.873    0.000    1.973    0.605
    v5T2      (L5)    0.981    0.147    6.659    0.000    0.959    0.405
    v6T2      (L6)    1.611    0.125   12.865    0.000    1.575    0.834
  Time3 =~                                                              
    v1T3      (L1)    3.004    0.249   12.073    0.000    2.621    0.969
    v2T3      (L2)    2.117    0.204   10.365    0.000    1.847    0.630
    v3T3      (L3)    2.139    0.200   10.699    0.000    1.866    0.772
    v4T3      (L4)    2.018    0.256    7.873    0.000    1.760    0.568
    v5T3      (L5)    0.981    0.147    6.659    0.000    0.856    0.446
    v6T3      (L6)    1.611    0.125   12.865    0.000    1.406    0.844

Covariances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
 .v1T1 ~~                                                               
   .v1T2   (C1T12)   -0.208    0.255   -0.815    0.415   -0.208   -0.361
   .v1T3   (C1T13)    0.035    0.235    0.150    0.880    0.035    0.062
 .v1T2 ~~                                                               
   .v1T3    (C1T2)    0.096    0.230    0.417    0.677    0.096    0.212
 .v2T1 ~~                                                               
   .v2T2   (C2T12)    3.930    0.678    5.796    0.000    3.930    0.552
   .v2T3   (C2T13)    2.107    0.792    2.659    0.008    2.107    0.318
 .v2T2 ~~                                                               
   .v2T3    (C2T2)    2.131    0.583    3.655    0.000    2.131    0.383
 .v3T1 ~~                                                               
   .v3T2   (C3T12)    0.953    0.281    3.388    0.001    0.953    0.431
   .v3T3   (C3T13)    1.090    0.279    3.911    0.000    1.090    0.479
 .v3T2 ~~                                                               
   .v3T3    (C3T2)    1.222    0.325    3.763    0.000    1.222    0.532
 .v4T1 ~~                                                               
   .v4T2   (C4T12)    4.821    0.874    5.515    0.000    4.821    0.688
   .v4T3   (C4T13)    3.895    1.031    3.778    0.000    3.895    0.565
 .v4T2 ~~                                                               
   .v4T3    (C4T2)    4.590    0.810    5.668    0.000    4.590    0.692
 .v5T1 ~~                                                               
   .v5T2   (C5T12)    2.325    0.762    3.052    0.002    2.325    0.796
   .v5T3   (C5T13)    1.403    0.435    3.223    0.001    1.403    0.605
 .v5T2 ~~                                                               
   .v5T3    (C5T2)    2.863    0.783    3.656    0.000    2.863    0.768
 .v6T1 ~~                                                               
   .v6T2   (C6T12)    0.809    0.158    5.133    0.000    0.809    0.609
   .v6T3   (C6T13)    0.559    0.176    3.172    0.002    0.559    0.490
 .v6T2 ~~                                                               
   .v6T3    (C6T2)    0.531    0.133    3.981    0.000    0.531    0.573
  Time1 ~~                                                              
    Time2             0.769    0.072   10.625    0.000    0.787    0.787
    Time3             0.626    0.115    5.431    0.000    0.717    0.717
  Time2 ~~                                                              
    Time3             0.573    0.116    4.935    0.000    0.671    0.671

Intercepts:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .v1T1    (I1T1)   16.086    0.274   58.644    0.000   16.086    5.150
   .v2T1    (I2T1)    8.662    0.299   28.948    0.000    8.662    2.406
   .v3T1    (I3T1)   11.965    0.226   52.891    0.000   11.965    4.600
   .v4T1    (I4T1)   -3.042    0.269  -11.325    0.000   -3.042   -0.903
   .v5T1    (I5T1)   -1.292    0.138   -9.363    0.000   -1.292   -0.775
   .v6T1    (I6T1)   -2.877    0.164  -17.490    0.000   -2.877   -1.399
   .v1T2    (I1T2)   17.230    0.245   70.337    0.000   17.230    5.716
   .v2T2    (I2T2)    9.983    0.264   37.869    0.000    9.983    3.119
   .v3T2    (I3T2)   12.472    0.217   57.359    0.000   12.472    4.851
   .v4T2    (I4T2)   -3.207    0.259  -12.367    0.000   -3.207   -0.983
   .v5T2    (I5T2)   -1.664    0.200   -8.334    0.000   -1.664   -0.702
   .v6T2    (I6T2)   -2.412    0.158  -15.294    0.000   -2.412   -1.278
   .v1T3    (I1T3)   17.768    0.221   80.464    0.000   17.768    6.567
   .v2T3    (I2T3)   10.431    0.280   37.301    0.000   10.431    3.557
   .v3T3    (I3T3)   13.041    0.212   61.633    0.000   13.041    5.395
   .v4T3    (I4T3)   -2.723    0.254  -10.709    0.000   -2.723   -0.878
   .v5T3    (I5T3)   -1.246    0.169   -7.382    0.000   -1.246   -0.649
   .v6T3    (I6T3)   -2.086    0.153  -13.615    0.000   -2.086   -1.253
    Time1             0.000                               0.000    0.000
    Time2             0.000                               0.000    0.000
    Time3             0.000                               0.000    0.000

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .v1T1    (E1T1)    0.729    0.353    2.064    0.039    0.729    0.075
   .v2T1    (E2T1)    8.485    1.026    8.270    0.000    8.485    0.654
   .v3T1    (E3T1)    2.190    0.334    6.552    0.000    2.190    0.324
   .v4T1    (E4T1)    7.281    1.045    6.968    0.000    7.281    0.641
   .v5T1    (E5T1)    1.819    0.444    4.096    0.000    1.819    0.654
   .v6T1    (E6T1)    1.635    0.237    6.906    0.000    1.635    0.386
   .v1T2    (E1T2)    0.455    0.263    1.730    0.084    0.455    0.050
   .v2T2    (E2T2)    5.963    0.612    9.738    0.000    5.963    0.582
   .v3T2    (E3T2)    2.235    0.361    6.191    0.000    2.235    0.338
   .v4T2    (E4T2)    6.745    0.964    6.996    0.000    6.745    0.634
   .v5T2    (E5T2)    4.694    1.429    3.286    0.001    4.694    0.836
   .v6T2    (E6T2)    1.082    0.162    6.674    0.000    1.082    0.304
   .v1T3    (E1T3)    0.452    0.325    1.391    0.164    0.452    0.062
   .v2T3    (E2T3)    5.187    0.793    6.538    0.000    5.187    0.603
   .v3T3    (E3T3)    2.361    0.427    5.527    0.000    2.361    0.404
   .v4T3    (E4T3)    6.522    1.101    5.925    0.000    6.522    0.678
   .v5T3    (E5T3)    2.958    0.772    3.834    0.000    2.958    0.802
   .v6T3    (E6T3)    0.796    0.169    4.699    0.000    0.796    0.287
    Time1             1.000                               1.000    1.000
    Time2             0.956    0.153    6.233    0.000    1.000    1.000
    Time3             0.761    0.134    5.663    0.000    1.000    1.000

R-Square:
                   Estimate
    v1T1              0.925
    v2T1              0.346
    v3T1              0.676
    v4T1              0.359
    v5T1              0.346
    v6T1              0.614
    v1T2              0.950
    v2T2              0.418
    v3T2              0.662
    v4T2              0.366
    v5T2              0.164
    v6T2              0.696
    v1T3              0.938
    v2T3              0.397
    v3T3              0.596
    v4T3              0.322
    v5T3              0.198
    v6T3              0.713

Does the metric model (metricEstimates1) fit worse than the configural model (configuralEstimates)? Yes, −2∆LL(df=10) = 19.14, p =.04.

anova(metricEstimates1, configuralEstimates)
Scaled Chi Square Difference Test (method = "satorra.bentler.2001")

                     Df    AIC    BIC  Chisq Chisq diff Df diff Pr(>Chisq)  
configuralEstimates 114 9010.6 9236.9 292.51                                
metricEstimates1    124 9014.8 9210.9 316.71     19.142      10     0.0385 *
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

To investigate which parameter to free, we will look at the modification indices:

#get modification indices for all parameters:
metricMI1 = modificationindices(metricEstimates1, free.remove = FALSE, maximum.number = 10000)
#restrict output to only factor loading parameters
metricMI1a = metricMI1[which(metricMI1$op == "=~"),]
#restrict output to only factors and items with same time point
metricMI1a$factorTime = metricMI1a$lhs
#extract time characters from items
metricMI1a$itemTime = substr(metricMI1a$rhs, 3, 4)
#convert to same name as factors
metricMI1a$itemTime[which(metricMI1a$itemTime == "T1")] = "Time1"
metricMI1a$itemTime[which(metricMI1a$itemTime == "T2")] = "Time2"
metricMI1a$itemTime[which(metricMI1a$itemTime == "T3")] = "Time3"
#show only MIs for same time
metricMI1b = metricMI1a[which(metricMI1a$itemTime == metricMI1a$factorTime),]
metricMI1b[order(-metricMI1b$mi),]
     lhs op  rhs    mi mi.scaled    epc sepc.lv sepc.all sepc.nox factorTime itemTime
18 Time3 =~ v6T3 5.684     5.406  0.210   0.183    0.110    0.110      Time3    Time3
1  Time1 =~ v1T1 5.678     5.400  0.271   0.271    0.087    0.087      Time1    Time1
11 Time2 =~ v5T2 3.302     3.140  0.186   0.182    0.077    0.077      Time2    Time2
5  Time1 =~ v5T1 3.297     3.136 -0.138  -0.138   -0.083   -0.083      Time1    Time1
6  Time1 =~ v6T1 2.694     2.562 -0.156  -0.156   -0.076   -0.076      Time1    Time1
13 Time3 =~ v1T3 1.817     1.729 -0.155  -0.135   -0.050   -0.050      Time3    Time3
10 Time2 =~ v4T2 0.946     0.899  0.150   0.147    0.045    0.045      Time2    Time2
15 Time3 =~ v3T3 0.924     0.879 -0.142  -0.124   -0.051   -0.051      Time3    Time3
7  Time2 =~ v1T2 0.826     0.786 -0.089  -0.087   -0.029   -0.029      Time2    Time2
17 Time3 =~ v5T3 0.633     0.602  0.102   0.089    0.046    0.046      Time3    Time3
2  Time1 =~ v2T1 0.553     0.526 -0.163  -0.163   -0.045   -0.045      Time1    Time1
12 Time2 =~ v6T2 0.542     0.515 -0.055  -0.054   -0.028   -0.028      Time2    Time2
9  Time2 =~ v3T2 0.423     0.402  0.076   0.074    0.029    0.029      Time2    Time2
16 Time3 =~ v4T3 0.410     0.390 -0.136  -0.119   -0.038   -0.038      Time3    Time3
14 Time3 =~ v2T3 0.396     0.377  0.151   0.132    0.045    0.045      Time3    Time3
4  Time1 =~ v4T1 0.339     0.323 -0.104  -0.104   -0.031   -0.031      Time1    Time1
8  Time2 =~ v2T2 0.020     0.019  0.025   0.025    0.008    0.008      Time2    Time2
3  Time1 =~ v3T1 0.013     0.012  0.014   0.014    0.005    0.005      Time1    Time1

From these MIs there are two that are large-ish, the loading of item1 at time1 and the loading of item3 at time3, which have almost the same values. For consistency with the Mplus example, we will select the loading of item1 at time1 to free and continue. In practice, we would free one of these two parameters, not necessarily the one we have chosen.

metricSyntax2 = "
#===================================================================================================
#Factor loadings constrained across groups except non-invariant ones *****
Time1 =~ L1T1*v1T1 + L2*v2T1 + L3*v3T1 + L4*v4T1 + L5*v5T1 + L6*v6T1
Time2 =~ L1*v1T2   + L2*v2T2 + L3*v3T2 + L4*v4T2 + L5*v5T2 + L6*v6T2
Time3 =~ L1*v1T3   + L2*v2T3 + L3*v3T3 + L4*v4T3 + L5*v5T3 + L6*v6T3
#===================================================================================================
#Item intercepts all freely estimated in each group with labels
v1T1 ~ I1T1*1; v2T1 ~ I2T1*1;  v3T1 ~ I3T1*1; v4T1 ~ I4T1*1; v5T1 ~ I5T1*1; v6T1 ~ I6T1*1; 
v1T2 ~ I1T2*1; v2T2 ~ I2T2*1;  v3T2 ~ I3T2*1; v4T2 ~ I4T2*1; v5T2 ~ I5T2*1; v6T2 ~ I6T2*1; 
v1T3 ~ I1T3*1; v2T3 ~ I2T3*1;  v3T3 ~ I3T3*1; v4T3 ~ I4T3*1; v5T3 ~ I5T3*1; v6T3 ~ I6T3*1; 
#===================================================================================================
#Redidual variances all freely estimated in each group with labels
v1T1 ~~ E1T1*v1T1; v2T1 ~~ E2T1*v2T1;  v3T1 ~~ E3T1*v3T1; v4T1 ~~ E4T1*v4T1; v5T1 ~~ E5T1*v5T1; v6T1 ~~ E6T1*v6T1;
v1T2 ~~ E1T2*v1T2; v2T2 ~~ E2T2*v2T2;  v3T2 ~~ E3T2*v3T2; v4T2 ~~ E4T2*v4T2; v5T2 ~~ E5T2*v5T2; v6T2 ~~ E6T2*v6T2;
v1T3 ~~ E1T3*v1T3; v2T3 ~~ E2T3*v2T3;  v3T3 ~~ E3T3*v3T3; v4T3 ~~ E4T3*v4T3; v5T3 ~~ E5T3*v5T3; v6T3 ~~ E6T3*v6T3;
#===================================================================================================
#Residual covariances freely estimated in each group with labels
v1T1 ~~ C1T12*v1T2 + C1T13*v1T3; v1T2 ~~ C1T23*v1T3; 
v2T1 ~~ C2T12*v2T2 + C2T13*v2T3; v2T2 ~~ C2T23*v2T3; 
v3T1 ~~ C3T12*v3T2 + C3T13*v3T3; v3T2 ~~ C3T23*v3T3; 
v4T1 ~~ C4T12*v4T2 + C4T13*v4T3; v4T2 ~~ C4T23*v4T3; 
v5T1 ~~ C5T12*v5T2 + C5T13*v5T3; v5T2 ~~ C5T23*v5T3; 
v6T1 ~~ C6T12*v6T2 + C6T13*v6T3; v6T2 ~~ C6T23*v6T3; 
#===================================================================================================
#Factor variance fixed to 1 for identification in first group; estimated in others *****
Time1 ~~ 1*Time1
Time2 ~~ Time2
Time3 ~~ Time3
#===================================================================================================
#Factor mean fixed to zero for identification in each group
Time1 ~ 0
Time2 ~ 0
Time3 ~ 0
#===================================================================================================
#Factor covariances all freely estimated
Time1 ~~ Time2 + Time3
Time2 ~~ Time3 
#===================================================================================================
"
metricEstimates2 = lavaan(model = metricSyntax2, data = cafData, estimator = "MLR", mimic = "mplus")
lavaan WARNING: some cases are empty and will be ignored:
  16 58 64 75 76 133 153 156
summary(metricEstimates2, fit.measures = TRUE, rsquare = TRUE, standardized = TRUE)
lavaan (0.5-23.1097) converged normally after 116 iterations

                                                  Used       Total
  Number of observations                           151         159

  Number of missing patterns                         7

  Estimator                                         ML      Robust
  Minimum Function Test Statistic              303.247     290.300
  Degrees of freedom                               123         123
  P-value (Chi-square)                           0.000       0.000
  Scaling correction factor                                  1.045
    for the Yuan-Bentler correction (Mplus variant)

Model test baseline model:

  Minimum Function Test Statistic             2192.158    1896.786
  Degrees of freedom                               153         153
  P-value                                        0.000       0.000

User model versus baseline model:

  Comparative Fit Index (CFI)                    0.912       0.904
  Tucker-Lewis Index (TLI)                       0.890       0.881

  Robust Comparative Fit Index (CFI)                         0.913
  Robust Tucker-Lewis Index (TLI)                            0.892

Loglikelihood and Information Criteria:

  Loglikelihood user model (H0)              -4435.669   -4435.669
  Scaling correction factor                                  1.284
    for the MLR correction
  Loglikelihood unrestricted model (H1)      -4284.045   -4284.045
  Scaling correction factor                                  1.203
    for the MLR correction

  Number of free parameters                         66          66
  Akaike (AIC)                                9003.337    9003.337
  Bayesian (BIC)                              9202.478    9202.478
  Sample-size adjusted Bayesian (BIC)         8993.595    8993.595

Root Mean Square Error of Approximation:

  RMSEA                                          0.099       0.095
  90 Percent Confidence Interval          0.085  0.113       0.081  0.109
  P-value RMSEA <= 0.05                          0.000       0.000

  Robust RMSEA                                               0.097
  90 Percent Confidence Interval                             0.083  0.111

Standardized Root Mean Square Residual:

  SRMR                                           0.091       0.091

Parameter Estimates:

  Information                                 Observed
  Standard Errors                   Robust.huber.white

Latent Variables:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  Time1 =~                                                              
    v1T1    (L1T1)    3.233    0.261   12.362    0.000    3.233    0.992
    v2T1      (L2)    1.950    0.201    9.707    0.000    1.950    0.551
    v3T1      (L3)    1.967    0.198    9.910    0.000    1.967    0.779
    v4T1      (L4)    1.899    0.224    8.481    0.000    1.899    0.578
    v5T1      (L5)    0.968    0.137    7.055    0.000    0.968    0.582
    v6T1      (L6)    1.476    0.131   11.247    0.000    1.476    0.749
  Time2 =~                                                              
    v1T2      (L1)    2.644    0.234   11.315    0.000    2.849    0.968
    v2T2      (L2)    1.950    0.201    9.707    0.000    2.102    0.655
    v3T2      (L3)    1.967    0.198    9.910    0.000    2.120    0.821
    v4T2      (L4)    1.899    0.224    8.481    0.000    2.047    0.619
    v5T2      (L5)    0.968    0.137    7.055    0.000    1.043    0.434
    v6T2      (L6)    1.476    0.131   11.247    0.000    1.591    0.836
  Time3 =~                                                              
    v1T3      (L1)    2.644    0.234   11.315    0.000    2.564    0.963
    v2T3      (L2)    1.950    0.201    9.707    0.000    1.892    0.639
    v3T3      (L3)    1.967    0.198    9.910    0.000    1.908    0.782
    v4T3      (L4)    1.899    0.224    8.481    0.000    1.842    0.582
    v5T3      (L5)    0.968    0.137    7.055    0.000    0.939    0.480
    v6T3      (L6)    1.476    0.131   11.247    0.000    1.432    0.850

Covariances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
 .v1T1 ~~                                                               
   .v1T2   (C1T12)   -0.225    0.249   -0.904    0.366   -0.225   -0.737
   .v1T3   (C1T13)   -0.012    0.236   -0.049    0.961   -0.012   -0.039
 .v1T2 ~~                                                               
   .v1T3    (C1T2)    0.132    0.230    0.574    0.566    0.132    0.250
 .v2T1 ~~                                                               
   .v2T2   (C2T12)    3.963    0.679    5.834    0.000    3.963    0.553
   .v2T3   (C2T13)    2.251    0.806    2.791    0.005    2.251    0.335
 .v2T2 ~~                                                               
   .v2T3    (C2T2)    2.142    0.580    3.691    0.000    2.142    0.388
 .v3T1 ~~                                                               
   .v3T2   (C3T12)    1.008    0.296    3.411    0.001    1.008    0.432
   .v3T3   (C3T13)    1.148    0.285    4.023    0.000    1.148    0.478
 .v3T2 ~~                                                               
   .v3T3    (C3T2)    1.175    0.316    3.717    0.000    1.175    0.524
 .v4T1 ~~                                                               
   .v4T2   (C4T12)    4.811    0.848    5.672    0.000    4.811    0.691
   .v4T3   (C4T13)    3.890    1.027    3.787    0.000    3.890    0.565
 .v4T2 ~~                                                               
   .v4T3    (C4T2)    4.685    0.827    5.667    0.000    4.685    0.701
 .v5T1 ~~                                                               
   .v5T2   (C5T12)    2.347    0.762    3.079    0.002    2.347    0.802
   .v5T3   (C5T13)    1.423    0.438    3.248    0.001    1.423    0.613
 .v5T2 ~~                                                               
   .v5T3    (C5T2)    2.868    0.779    3.684    0.000    2.868    0.773
 .v6T1 ~~                                                               
   .v6T2   (C6T12)    0.833    0.164    5.090    0.000    0.833    0.610
   .v6T3   (C6T13)    0.592    0.177    3.350    0.001    0.592    0.511
 .v6T2 ~~                                                               
   .v6T3    (C6T2)    0.533    0.135    3.951    0.000    0.533    0.576
  Time1 ~~                                                              
    Time2             0.847    0.078   10.837    0.000    0.786    0.786
    Time3             0.682    0.124    5.508    0.000    0.703    0.703
  Time2 ~~                                                              
    Time3             0.699    0.128    5.473    0.000    0.669    0.669

Intercepts:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .v1T1    (I1T1)   16.078    0.276   58.267    0.000   16.078    4.934
   .v2T1    (I2T1)    8.672    0.298   29.071    0.000    8.672    2.452
   .v3T1    (I3T1)   11.978    0.225   53.192    0.000   11.978    4.745
   .v4T1    (I4T1)   -3.034    0.267  -11.343    0.000   -3.034   -0.924
   .v5T1    (I5T1)   -1.288    0.137   -9.377    0.000   -1.288   -0.775
   .v6T1    (I6T1)   -2.871    0.164  -17.506    0.000   -2.871   -1.457
   .v1T2    (I1T2)   17.225    0.245   70.282    0.000   17.225    5.851
   .v2T2    (I2T2)    9.980    0.264   37.872    0.000    9.980    3.108
   .v3T2    (I3T2)   12.468    0.217   57.325    0.000   12.468    4.826
   .v4T2    (I4T2)   -3.210    0.260  -12.365    0.000   -3.210   -0.970
   .v5T2    (I5T2)   -1.663    0.199   -8.340    0.000   -1.663   -0.692
   .v6T2    (I6T2)   -2.414    0.158  -15.319    0.000   -2.414   -1.269
   .v1T3    (I1T3)   17.756    0.222   80.036    0.000   17.756    6.671
   .v2T3    (I2T3)   10.434    0.280   37.245    0.000   10.434    3.526
   .v3T3    (I3T3)   13.041    0.212   61.441    0.000   13.041    5.347
   .v4T3    (I4T3)   -2.720    0.254  -10.720    0.000   -2.720   -0.860
   .v5T3    (I5T3)   -1.246    0.169   -7.373    0.000   -1.246   -0.637
   .v6T3    (I6T3)   -2.087    0.154  -13.571    0.000   -2.087   -1.240
    Time1             0.000                               0.000    0.000
    Time2             0.000                               0.000    0.000
    Time3             0.000                               0.000    0.000

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .v1T1    (E1T1)    0.170    0.374    0.454    0.650    0.170    0.016
   .v2T1    (E2T1)    8.702    1.026    8.483    0.000    8.702    0.696
   .v3T1    (E3T1)    2.502    0.386    6.484    0.000    2.502    0.393
   .v4T1    (E4T1)    7.172    1.021    7.021    0.000    7.172    0.665
   .v5T1    (E5T1)    1.829    0.443    4.131    0.000    1.829    0.661
   .v6T1    (E6T1)    1.707    0.242    7.059    0.000    1.707    0.439
   .v1T2    (E1T2)    0.548    0.265    2.070    0.038    0.548    0.063
   .v2T2    (E2T2)    5.895    0.605    9.746    0.000    5.895    0.572
   .v3T2    (E3T2)    2.178    0.352    6.183    0.000    2.178    0.326
   .v4T2    (E4T2)    6.759    0.967    6.990    0.000    6.759    0.617
   .v5T2    (E5T2)    4.678    1.430    3.272    0.001    4.678    0.811
   .v6T2    (E6T2)    1.090    0.165    6.599    0.000    1.090    0.301
   .v1T3    (E1T3)    0.509    0.314    1.618    0.106    0.509    0.072
   .v2T3    (E2T3)    5.177    0.795    6.514    0.000    5.177    0.591
   .v3T3    (E3T3)    2.309    0.416    5.548    0.000    2.309    0.388
   .v4T3    (E4T3)    6.613    1.129    5.860    0.000    6.613    0.661
   .v5T3    (E5T3)    2.944    0.760    3.872    0.000    2.944    0.770
   .v6T3    (E6T3)    0.784    0.170    4.618    0.000    0.784    0.277
    Time1             1.000                               1.000    1.000
    Time2             1.162    0.185    6.270    0.000    1.000    1.000
    Time3             0.941    0.157    5.999    0.000    1.000    1.000

R-Square:
                   Estimate
    v1T1              0.984
    v2T1              0.304
    v3T1              0.607
    v4T1              0.335
    v5T1              0.339
    v6T1              0.561
    v1T2              0.937
    v2T2              0.428
    v3T2              0.674
    v4T2              0.383
    v5T2              0.189
    v6T2              0.699
    v1T3              0.928
    v2T3              0.409
    v3T3              0.612
    v4T3              0.339
    v5T3              0.230
    v6T3              0.723
anova(metricEstimates2, configuralEstimates)
Scaled Chi Square Difference Test (method = "satorra.bentler.2001")

                     Df    AIC    BIC  Chisq Chisq diff Df diff Pr(>Chisq)
configuralEstimates 114 9010.6 9236.9 292.51                              
metricEstimates2    123 9003.3 9202.5 303.25      8.981       9      0.439

The likelihood ratio test suggests that the partial metric invariance model fits as well as the configural model.

#get modification indices for all parameters:
metricMI2 = modificationindices(metricEstimates2, free.remove = FALSE, maximum.number = 10000)
#restrict output to only factor loading parameters
metricMI2a = metricMI2[which(metricMI2$op == "=~"),]
#restrict output to only factors and items with same time point
metricMI2a$factorTime = metricMI2a$lhs
#extract time characters from items
metricMI2a$itemTime = substr(metricMI2a$rhs, 3, 4)
#convert to same name as factors
metricMI2a$itemTime[which(metricMI2a$itemTime == "T1")] = "Time1"
metricMI2a$itemTime[which(metricMI2a$itemTime == "T2")] = "Time2"
metricMI2a$itemTime[which(metricMI2a$itemTime == "T3")] = "Time3"
#show only MIs for same time
metricMI2b = metricMI2a[which(metricMI2a$itemTime == metricMI2a$factorTime),]
metricMI2b[order(-metricMI2b$mi),]
     lhs op  rhs    mi mi.scaled    epc sepc.lv sepc.all sepc.nox factorTime itemTime
18 Time3 =~ v6T3 3.279     3.139  0.143   0.138    0.082    0.082      Time3    Time3
15 Time3 =~ v3T3 2.363     2.262 -0.204  -0.197   -0.081   -0.081      Time3    Time3
12 Time2 =~ v6T2 2.020     1.934 -0.097  -0.105   -0.055   -0.055      Time2    Time2
11 Time2 =~ v5T2 1.506     1.442  0.112   0.121    0.050    0.050      Time2    Time2
5  Time1 =~ v5T1 1.393     1.333 -0.086  -0.086   -0.052   -0.052      Time1    Time1
16 Time3 =~ v4T3 1.030     0.986 -0.194  -0.188   -0.059   -0.059      Time3    Time3
3  Time1 =~ v3T1 1.024     0.980  0.124   0.124    0.049    0.049      Time1    Time1
10 Time2 =~ v4T2 0.192     0.184  0.061   0.066    0.020    0.020      Time2    Time2
4  Time1 =~ v4T1 0.139     0.133  0.064   0.064    0.020    0.020      Time1    Time1
14 Time3 =~ v2T3 0.127     0.122  0.077   0.075    0.025    0.025      Time3    Time3
9  Time2 =~ v3T2 0.125     0.120  0.037   0.040    0.016    0.016      Time2    Time2
17 Time3 =~ v5T3 0.100     0.095  0.036   0.035    0.018    0.018      Time3    Time3
13 Time3 =~ v1T3 0.072     0.069 -0.028  -0.027   -0.010   -0.010      Time3    Time3
7  Time2 =~ v1T2 0.054     0.052  0.021   0.022    0.008    0.008      Time2    Time2
6  Time1 =~ v6T1 0.041     0.040 -0.019  -0.019   -0.010   -0.010      Time1    Time1
2  Time1 =~ v2T1 0.025     0.024 -0.034  -0.034   -0.010   -0.010      Time1    Time1
8  Time2 =~ v2T2 0.022     0.021 -0.024  -0.026   -0.008   -0.008      Time2    Time2
1  Time1 =~ v1T1 0.000     0.000  0.000   0.000    0.000    0.000      Time1    Time1

The modification indices indicate no other changes are needed, so we can continue.

3. Scalar Invariance Models (ALL loadings held equal across time - identified model using Time1 Factor Mean = 1)

scalarSyntax1 = "
#===================================================================================================
#Factor loadings constrained across groups except non-invariant ones
Time1 =~ L1T1*v1T1 + L2*v2T1 + L3*v3T1 + L4*v4T1 + L5*v5T1 + L6*v6T1
Time2 =~ L1*v1T2 + L2*v2T2 + L3*v3T2 + L4*v4T2 + L5*v5T2 + L6*v6T2
Time3 =~ L1*v1T3 + L2*v2T3 + L3*v3T3 + L4*v4T3 + L5*v5T3 + L6*v6T3
#===================================================================================================
#Item intercepts all constrained across groups except non-invariant ones ****
v1T1 ~ I1T1*1; v2T1 ~ I2*1;  v3T1 ~ I3*1; v4T1 ~ I4*1; v5T1 ~ I5*1; v6T1 ~ I6*1; 
v1T2 ~ I1*1;   v2T2 ~ I2*1;  v3T2 ~ I3*1; v4T2 ~ I4*1; v5T2 ~ I5*1; v6T2 ~ I6*1; 
v1T3 ~ I1*1;   v2T3 ~ I2*1;  v3T3 ~ I3*1; v4T3 ~ I4*1; v5T3 ~ I5*1; v6T3 ~ I6*1; 
#===================================================================================================
#Redidual variances all freely estimated in each group with labels
v1T1 ~~ E1T1*v1T1; v2T1 ~~ E2T1*v2T1;  v3T1 ~~ E3T1*v3T1; v4T1 ~~ E4T1*v4T1; v5T1 ~~ E5T1*v5T1; v6T1 ~~ E6T1*v6T1;
v1T2 ~~ E1T2*v1T2; v2T2 ~~ E2T2*v2T2;  v3T2 ~~ E3T2*v3T2; v4T2 ~~ E4T2*v4T2; v5T2 ~~ E5T2*v5T2; v6T2 ~~ E6T2*v6T2;
v1T3 ~~ E1T3*v1T3; v2T3 ~~ E2T3*v2T3;  v3T3 ~~ E3T3*v3T3; v4T3 ~~ E4T3*v4T3; v5T3 ~~ E5T3*v5T3; v6T3 ~~ E6T3*v6T3;
#===================================================================================================
#Residual covariances freely estimated in each group with labels
v1T1 ~~ C1T12*v1T2 + C1T13*v1T3; v1T2 ~~ C1T23*v1T3; 
v2T1 ~~ C2T12*v2T2 + C2T13*v2T3; v2T2 ~~ C2T23*v2T3; 
v3T1 ~~ C3T12*v3T2 + C3T13*v3T3; v3T2 ~~ C3T23*v3T3; 
v4T1 ~~ C4T12*v4T2 + C4T13*v4T3; v4T2 ~~ C4T23*v4T3; 
v5T1 ~~ C5T12*v5T2 + C5T13*v5T3; v5T2 ~~ C5T23*v5T3; 
v6T1 ~~ C6T12*v6T2 + C6T13*v6T3; v6T2 ~~ C6T23*v6T3; 
#===================================================================================================
#Factor variance fixed to 1 for identification in first group; estimated in others
Time1 ~~ 1*Time1
Time2 ~~ Time2
Time3 ~~ Time3
#===================================================================================================
#Factor mean fixed to zero for identification first group, estimated in others ****
Time1 ~ 0
Time2 ~ 1
Time3 ~ 1
#===================================================================================================
#Factor covariances all freely estimated
Time1 ~~ Time2 + Time3
Time2 ~~ Time3 
"
scalarEstimates1 = lavaan(model = scalarSyntax1, data = cafData, estimator = "MLR", mimic = "mplus")
lavaan WARNING: some cases are empty and will be ignored:
  16 58 64 75 76 133 153 156
summary(scalarEstimates1, fit.measures = TRUE, rsquare = TRUE, standardized = TRUE)
lavaan (0.5-23.1097) converged normally after 116 iterations

                                                  Used       Total
  Number of observations                           151         159

  Number of missing patterns                         7

  Estimator                                         ML      Robust
  Minimum Function Test Statistic              355.594     342.529
  Degrees of freedom                               132         132
  P-value (Chi-square)                           0.000       0.000
  Scaling correction factor                                  1.038
    for the Yuan-Bentler correction (Mplus variant)

Model test baseline model:

  Minimum Function Test Statistic             2192.158    1896.786
  Degrees of freedom                               153         153
  P-value                                        0.000       0.000

User model versus baseline model:

  Comparative Fit Index (CFI)                    0.890       0.879
  Tucker-Lewis Index (TLI)                       0.873       0.860

  Robust Comparative Fit Index (CFI)                         0.892
  Robust Tucker-Lewis Index (TLI)                            0.874

Loglikelihood and Information Criteria:

  Loglikelihood user model (H0)              -4461.842   -4461.842
  Scaling correction factor                                  1.143
    for the MLR correction
  Loglikelihood unrestricted model (H1)      -4284.045   -4284.045
  Scaling correction factor                                  1.203
    for the MLR correction

  Number of free parameters                         57          57
  Akaike (AIC)                                9037.685    9037.685
  Bayesian (BIC)                              9209.670    9209.670
  Sample-size adjusted Bayesian (BIC)         9029.271    9029.271

Root Mean Square Error of Approximation:

  RMSEA                                          0.106       0.103
  90 Percent Confidence Interval          0.093  0.119       0.090  0.116
  P-value RMSEA <= 0.05                          0.000       0.000

  Robust RMSEA                                               0.105
  90 Percent Confidence Interval                             0.091  0.118

Standardized Root Mean Square Residual:

  SRMR                                           0.093       0.093

Parameter Estimates:

  Information                                 Observed
  Standard Errors                   Robust.huber.white

Latent Variables:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  Time1 =~                                                              
    v1T1    (L1T1)    3.223    0.264   12.216    0.000    3.223    0.988
    v2T1      (L2)    2.072    0.198   10.454    0.000    2.072    0.563
    v3T1      (L3)    2.023    0.193   10.496    0.000    2.023    0.791
    v4T1      (L4)    1.794    0.234    7.660    0.000    1.794    0.553
    v5T1      (L5)    0.907    0.152    5.962    0.000    0.907    0.555
    v6T1      (L6)    1.516    0.127   11.977    0.000    1.516    0.759
  Time2 =~                                                              
    v1T2      (L1)    2.662    0.230   11.597    0.000    2.834    0.964
    v2T2      (L2)    2.072    0.198   10.454    0.000    2.206    0.673
    v3T2      (L3)    2.023    0.193   10.496    0.000    2.153    0.827
    v4T2      (L4)    1.794    0.234    7.660    0.000    1.910    0.593
    v5T2      (L5)    0.907    0.152    5.962    0.000    0.966    0.390
    v6T2      (L6)    1.516    0.127   11.977    0.000    1.613    0.841
  Time3 =~                                                              
    v1T3      (L1)    2.662    0.230   11.597    0.000    2.557    0.960
    v2T3      (L2)    2.072    0.198   10.454    0.000    1.991    0.663
    v3T3      (L3)    2.023    0.193   10.496    0.000    1.943    0.789
    v4T3      (L4)    1.794    0.234    7.660    0.000    1.724    0.560
    v5T3      (L5)    0.907    0.152    5.962    0.000    0.872    0.438
    v6T3      (L6)    1.516    0.127   11.977    0.000    1.456    0.858

Covariances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
 .v1T1 ~~                                                               
   .v1T2   (C1T12)   -0.187    0.251   -0.746    0.456   -0.187   -0.484
   .v1T3   (C1T13)    0.026    0.240    0.107    0.914    0.026    0.069
 .v1T2 ~~                                                               
   .v1T3    (C1T2)    0.140    0.230    0.610    0.542    0.140    0.242
 .v2T1 ~~                                                               
   .v2T2   (C2T12)    3.926    0.712    5.517    0.000    3.926    0.532
   .v2T3   (C2T13)    2.047    0.812    2.519    0.012    2.047    0.299
 .v2T2 ~~                                                               
   .v2T3    (C2T2)    2.079    0.560    3.715    0.000    2.079    0.381
 .v3T1 ~~                                                               
   .v3T2   (C3T12)    0.985    0.291    3.378    0.001    0.985    0.430
   .v3T3   (C3T13)    1.090    0.289    3.770    0.000    1.090    0.462
 .v3T2 ~~                                                               
   .v3T3    (C3T2)    1.166    0.317    3.675    0.000    1.166    0.527
 .v4T1 ~~                                                               
   .v4T2   (C4T12)    4.606    0.837    5.501    0.000    4.606    0.658
   .v4T3   (C4T13)    3.681    1.016    3.624    0.000    3.681    0.534
 .v4T2 ~~                                                               
   .v4T3    (C4T2)    4.515    0.796    5.674    0.000    4.515    0.683
 .v5T1 ~~                                                               
   .v5T2   (C5T12)    2.430    0.835    2.910    0.004    2.430    0.785
   .v5T3   (C5T13)    1.487    0.489    3.041    0.002    1.487    0.613
 .v5T2 ~~                                                               
   .v5T3    (C5T2)    3.203    0.935    3.425    0.001    3.203    0.786
 .v6T1 ~~                                                               
   .v6T2   (C6T12)    0.823    0.166    4.959    0.000    0.823    0.611
   .v6T3   (C6T13)    0.571    0.177    3.231    0.001    0.571    0.505
 .v6T2 ~~                                                               
   .v6T3    (C6T2)    0.519    0.134    3.884    0.000    0.519    0.576
  Time1 ~~                                                              
    Time2             0.837    0.077   10.811    0.000    0.787    0.787
    Time3             0.678    0.121    5.588    0.000    0.706    0.706
  Time2 ~~                                                              
    Time3             0.689    0.124    5.553    0.000    0.674    0.674

Intercepts:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .v1T1    (I1T1)   16.089    0.274   58.671    0.000   16.089    4.933
   .v2T1      (I2)    9.368    0.263   35.672    0.000    9.368    2.545
   .v3T1      (I3)   12.026    0.227   53.055    0.000   12.026    4.704
   .v4T1      (I4)   -3.388    0.261  -12.988    0.000   -3.388   -1.045
   .v5T1      (I5)   -1.189    0.125   -9.520    0.000   -1.189   -0.728
   .v6T1      (I6)   -2.775    0.169  -16.456    0.000   -2.775   -1.390
   .v1T2      (I1)   16.589    0.281   59.112    0.000   16.589    5.646
   .v2T2      (I2)    9.368    0.263   35.672    0.000    9.368    2.859
   .v3T2      (I3)   12.026    0.227   53.055    0.000   12.026    4.618
   .v4T2      (I4)   -3.388    0.261  -12.988    0.000   -3.388   -1.052
   .v5T2      (I5)   -1.189    0.125   -9.520    0.000   -1.189   -0.480
   .v6T2      (I6)   -2.775    0.169  -16.456    0.000   -2.775   -1.447
   .v1T3      (I1)   16.589    0.281   59.112    0.000   16.589    6.226
   .v2T3      (I2)    9.368    0.263   35.672    0.000    9.368    3.119
   .v3T3      (I3)   12.026    0.227   53.055    0.000   12.026    4.885
   .v4T3      (I4)   -3.388    0.261  -12.988    0.000   -3.388   -1.100
   .v5T3      (I5)   -1.189    0.125   -9.520    0.000   -1.189   -0.598
   .v6T3      (I6)   -2.775    0.169  -16.456    0.000   -2.775   -1.636
    Time1             0.000                               0.000    0.000
    Time2             0.228    0.081    2.831    0.005    0.214    0.214
    Time3             0.452    0.083    5.456    0.000    0.471    0.471

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .v1T1    (E1T1)    0.247    0.390    0.635    0.526    0.247    0.023
   .v2T1    (E2T1)    9.256    1.165    7.947    0.000    9.256    0.683
   .v3T1    (E3T1)    2.443    0.391    6.243    0.000    2.443    0.374
   .v4T1    (E4T1)    7.291    1.014    7.189    0.000    7.291    0.694
   .v5T1    (E5T1)    1.846    0.458    4.027    0.000    1.846    0.692
   .v6T1    (E6T1)    1.692    0.247    6.849    0.000    1.692    0.424
   .v1T2    (E1T2)    0.603    0.269    2.247    0.025    0.603    0.070
   .v2T2    (E2T2)    5.874    0.599    9.812    0.000    5.874    0.547
   .v3T2    (E3T2)    2.145    0.351    6.115    0.000    2.145    0.316
   .v4T2    (E4T2)    6.714    0.962    6.978    0.000    6.714    0.648
   .v5T2    (E5T2)    5.196    1.648    3.153    0.002    5.196    0.848
   .v6T2    (E6T2)    1.073    0.164    6.560    0.000    1.073    0.292
   .v1T3    (E1T3)    0.560    0.312    1.794    0.073    0.560    0.079
   .v2T3    (E2T3)    5.060    0.769    6.577    0.000    5.060    0.561
   .v3T3    (E3T3)    2.284    0.416    5.494    0.000    2.284    0.377
   .v4T3    (E4T3)    6.512    1.117    5.832    0.000    6.512    0.687
   .v5T3    (E5T3)    3.193    0.882    3.620    0.000    3.193    0.808
   .v6T3    (E6T3)    0.757    0.169    4.484    0.000    0.757    0.263
    Time1             1.000                               1.000    1.000
    Time2             1.133    0.179    6.315    0.000    1.000    1.000
    Time3             0.923    0.152    6.082    0.000    1.000    1.000

R-Square:
                   Estimate
    v1T1              0.977
    v2T1              0.317
    v3T1              0.626
    v4T1              0.306
    v5T1              0.308
    v6T1              0.576
    v1T2              0.930
    v2T2              0.453
    v3T2              0.684
    v4T2              0.352
    v5T2              0.152
    v6T2              0.708
    v1T3              0.921
    v2T3              0.439
    v3T3              0.623
    v4T3              0.313
    v5T3              0.192
    v6T3              0.737
anova(metricEstimates2, scalarEstimates1)
Scaled Chi Square Difference Test (method = "satorra.bentler.2001")

                  Df    AIC    BIC  Chisq Chisq diff Df diff Pr(>Chisq)    
metricEstimates2 123 9003.3 9202.5 303.25                                  
scalarEstimates1 132 9037.7 9209.7 355.59     55.106       9  1.162e-08 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
anova(configuralEstimates, scalarEstimates1)
Scaled Chi Square Difference Test (method = "satorra.bentler.2001")

                     Df    AIC    BIC  Chisq Chisq diff Df diff Pr(>Chisq)    
configuralEstimates 114 9010.6 9236.9 292.51                                  
scalarEstimates1    132 9037.7 9209.7 355.59     58.816      18  3.174e-06 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Does the full scalar model (3a) fit worse than the partial metric model (2b)? Yes, −2∆LL(df=9) = 55.13, p <.01. A look at the modification indices reveals a number of items with large values. We will pick the intercept from item2 at time1 to free.

#get modification indices for all parameters:
scalarMI1 = modificationindices(scalarEstimates1, free.remove = FALSE, maximum.number = 10000)
#restrict output to only factor loading parameters
scalarMI1a = scalarMI1[which(scalarMI1$op == "~1"),]
scalarMI1a[order(-scalarMI1a$mi),]
     lhs op rhs     mi mi.scaled    epc sepc.lv sepc.all sepc.nox
20  v2T1 ~1     12.968    12.491 -0.814  -0.814   -0.221   -0.221
29  v5T2 ~1     12.432    11.975 -0.364  -0.364   -0.147   -0.147
23  v5T1 ~1      8.446     8.136  0.219   0.219    0.134    0.134
22  v4T1 ~1      8.406     8.097  0.519   0.519    0.160    0.160
28  v4T2 ~1      4.843     4.665 -0.335  -0.335   -0.104   -0.104
26  v2T2 ~1      4.608     4.438  0.376   0.376    0.115    0.115
24  v6T1 ~1      1.667     1.606 -0.120  -0.120   -0.060   -0.060
33  v3T3 ~1      1.131     1.089  0.134   0.134    0.055    0.055
31  v1T3 ~1      0.702     0.676 -0.085  -0.085   -0.032   -0.032
25  v1T2 ~1      0.657     0.633  0.079   0.079    0.027    0.027
30  v6T2 ~1      0.631     0.607  0.058   0.058    0.030    0.030
32  v2T3 ~1      0.563     0.542  0.153   0.153    0.051    0.051
21  v3T1 ~1      0.362     0.349 -0.073  -0.073   -0.029   -0.029
35  v5T3 ~1      0.230     0.221 -0.053  -0.053   -0.026   -0.026
27  v3T2 ~1      0.151     0.146 -0.043  -0.043   -0.017   -0.017
34  v4T3 ~1      0.104     0.100 -0.059  -0.059   -0.019   -0.019
36  v6T3 ~1      0.049     0.047  0.017   0.017    0.010    0.010
78 Time3 ~1      0.000     0.000  0.000   0.000    0.000    0.000
77 Time2 ~1      0.000     0.000  0.000   0.000    0.000    0.000
19  v1T1 ~1      0.000     0.000  0.000   0.000    0.000    0.000
scalarSyntax2 = "
#===================================================================================================
#Factor loadings constrained across groups except non-invariant ones
Time1 =~ L1T1*v1T1 + L2*v2T1 + L3*v3T1 + L4*v4T1 + L5*v5T1 + L6*v6T1
Time2 =~ L1*v1T2 + L2*v2T2 + L3*v3T2 + L4*v4T2 + L5*v5T2 + L6*v6T2
Time3 =~ L1*v1T3 + L2*v2T3 + L3*v3T3 + L4*v4T3 + L5*v5T3 + L6*v6T3
#===================================================================================================
#Item intercepts all constrained across groups except non-invariant ones ****
v1T1 ~ I1T1*1; v2T1 ~ I2T1*1;  v3T1 ~ I3*1; v4T1 ~ I4*1; v5T1 ~ I5*1; v6T1 ~ I6*1; 
v1T2 ~ I1*1;   v2T2 ~ I2*1;  v3T2 ~ I3*1; v4T2 ~ I4*1; v5T2 ~ I5*1; v6T2 ~ I6*1; 
v1T3 ~ I1*1;   v2T3 ~ I2*1;  v3T3 ~ I3*1; v4T3 ~ I4*1; v5T3 ~ I5*1; v6T3 ~ I6*1; 
#===================================================================================================
#Redidual variances all freely estimated in each group with labels
v1T1 ~~ E1T1*v1T1; v2T1 ~~ E2T1*v2T1;  v3T1 ~~ E3T1*v3T1; v4T1 ~~ E4T1*v4T1; v5T1 ~~ E5T1*v5T1; v6T1 ~~ E6T1*v6T1;
v1T2 ~~ E1T2*v1T2; v2T2 ~~ E2T2*v2T2;  v3T2 ~~ E3T2*v3T2; v4T2 ~~ E4T2*v4T2; v5T2 ~~ E5T2*v5T2; v6T2 ~~ E6T2*v6T2;
v1T3 ~~ E1T3*v1T3; v2T3 ~~ E2T3*v2T3;  v3T3 ~~ E3T3*v3T3; v4T3 ~~ E4T3*v4T3; v5T3 ~~ E5T3*v5T3; v6T3 ~~ E6T3*v6T3;
#===================================================================================================
#Residual covariances freely estimated in each group with labels
v1T1 ~~ C1T12*v1T2 + C1T13*v1T3; v1T2 ~~ C1T23*v1T3; 
v2T1 ~~ C2T12*v2T2 + C2T13*v2T3; v2T2 ~~ C2T23*v2T3; 
v3T1 ~~ C3T12*v3T2 + C3T13*v3T3; v3T2 ~~ C3T23*v3T3; 
v4T1 ~~ C4T12*v4T2 + C4T13*v4T3; v4T2 ~~ C4T23*v4T3; 
v5T1 ~~ C5T12*v5T2 + C5T13*v5T3; v5T2 ~~ C5T23*v5T3; 
v6T1 ~~ C6T12*v6T2 + C6T13*v6T3; v6T2 ~~ C6T23*v6T3; 
#===================================================================================================
#Factor variance fixed to 1 for identification in first group; estimated in others
Time1 ~~ 1*Time1
Time2 ~~ Time2
Time3 ~~ Time3
#===================================================================================================
#Factor mean fixed to zero for identification first group, estimated in others ****
Time1 ~ 0
Time2 ~ 1
Time3 ~ 1
#===================================================================================================
#Factor covariances all freely estimated
Time1 ~~ Time2 + Time3
Time2 ~~ Time3 
"
scalarEstimates2 = lavaan(model = scalarSyntax2, data = cafData, estimator = "MLR", mimic = "mplus")
lavaan WARNING: some cases are empty and will be ignored:
  16 58 64 75 76 133 153 156
summary(scalarEstimates2, fit.measures = TRUE, rsquare = TRUE, standardized = TRUE)
lavaan (0.5-23.1097) converged normally after 116 iterations

                                                  Used       Total
  Number of observations                           151         159

  Number of missing patterns                         7

  Estimator                                         ML      Robust
  Minimum Function Test Statistic              339.321     327.268
  Degrees of freedom                               131         131
  P-value (Chi-square)                           0.000       0.000
  Scaling correction factor                                  1.037
    for the Yuan-Bentler correction (Mplus variant)

Model test baseline model:

  Minimum Function Test Statistic             2192.158    1896.786
  Degrees of freedom                               153         153
  P-value                                        0.000       0.000

User model versus baseline model:

  Comparative Fit Index (CFI)                    0.898       0.887
  Tucker-Lewis Index (TLI)                       0.881       0.869

  Robust Comparative Fit Index (CFI)                         0.899
  Robust Tucker-Lewis Index (TLI)                            0.882

Loglikelihood and Information Criteria:

  Loglikelihood user model (H0)              -4453.706   -4453.706
  Scaling correction factor                                  1.159
    for the MLR correction
  Loglikelihood unrestricted model (H1)      -4284.045   -4284.045
  Scaling correction factor                                  1.203
    for the MLR correction

  Number of free parameters                         58          58
  Akaike (AIC)                                9023.412    9023.412
  Bayesian (BIC)                              9198.414    9198.414
  Sample-size adjusted Bayesian (BIC)         9014.850    9014.850

Root Mean Square Error of Approximation:

  RMSEA                                          0.103       0.100
  90 Percent Confidence Interval          0.089  0.116       0.086  0.113
  P-value RMSEA <= 0.05                          0.000       0.000

  Robust RMSEA                                               0.101
  90 Percent Confidence Interval                             0.088  0.115

Standardized Root Mean Square Residual:

  SRMR                                           0.092       0.092

Parameter Estimates:

  Information                                 Observed
  Standard Errors                   Robust.huber.white

Latent Variables:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  Time1 =~                                                              
    v1T1    (L1T1)    3.227    0.263   12.260    0.000    3.227    0.990
    v2T1      (L2)    1.977    0.201    9.826    0.000    1.977    0.558
    v3T1      (L3)    2.023    0.195   10.359    0.000    2.023    0.789
    v4T1      (L4)    1.829    0.232    7.889    0.000    1.829    0.562
    v5T1      (L5)    0.927    0.150    6.165    0.000    0.927    0.564
    v6T1      (L6)    1.511    0.130   11.634    0.000    1.511    0.756
  Time2 =~                                                              
    v1T2      (L1)    2.652    0.230   11.505    0.000    2.836    0.965
    v2T2      (L2)    1.977    0.201    9.826    0.000    2.114    0.658
    v3T2      (L3)    2.023    0.195   10.359    0.000    2.163    0.828
    v4T2      (L4)    1.829    0.232    7.889    0.000    1.956    0.602
    v5T2      (L5)    0.927    0.150    6.165    0.000    0.991    0.401
    v6T2      (L6)    1.511    0.130   11.634    0.000    1.616    0.841
  Time3 =~                                                              
    v1T3      (L1)    2.652    0.230   11.505    0.000    2.559    0.961
    v2T3      (L2)    1.977    0.201    9.826    0.000    1.907    0.644
    v3T3      (L3)    2.023    0.195   10.359    0.000    1.952    0.790
    v4T3      (L4)    1.829    0.232    7.889    0.000    1.765    0.568
    v5T3      (L5)    0.927    0.150    6.165    0.000    0.894    0.450
    v6T3      (L6)    1.511    0.130   11.634    0.000    1.458    0.858

Covariances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
 .v1T1 ~~                                                               
   .v1T2   (C1T12)   -0.196    0.250   -0.783    0.434   -0.196   -0.543
   .v1T3   (C1T13)    0.009    0.239    0.037    0.971    0.009    0.026
 .v1T2 ~~                                                               
   .v1T3    (C1T2)    0.133    0.231    0.574    0.566    0.133    0.234
 .v2T1 ~~                                                               
   .v2T2   (C2T12)    3.948    0.679    5.818    0.000    3.948    0.554
   .v2T3   (C2T13)    2.234    0.799    2.794    0.005    2.234    0.335
 .v2T2 ~~                                                               
   .v2T3    (C2T2)    2.144    0.563    3.804    0.000    2.144    0.391
 .v3T1 ~~                                                               
   .v3T2   (C3T12)    0.989    0.295    3.349    0.001    0.989    0.429
   .v3T3   (C3T13)    1.091    0.292    3.732    0.000    1.091    0.457
 .v3T2 ~~                                                               
   .v3T3    (C3T2)    1.171    0.319    3.673    0.000    1.171    0.527
 .v4T1 ~~                                                               
   .v4T2   (C4T12)    4.665    0.840    5.550    0.000    4.665    0.668
   .v4T3   (C4T13)    3.742    1.019    3.674    0.000    3.742    0.543
 .v4T2 ~~                                                               
   .v4T3    (C4T2)    4.561    0.805    5.667    0.000    4.561    0.688
 .v5T1 ~~                                                               
   .v5T2   (C5T12)    2.417    0.826    2.927    0.003    2.417    0.788
   .v5T3   (C5T13)    1.475    0.480    3.071    0.002    1.475    0.613
 .v5T2 ~~                                                               
   .v5T3    (C5T2)    3.147    0.914    3.443    0.001    3.147    0.785
 .v6T1 ~~                                                               
   .v6T2   (C6T12)    0.813    0.168    4.838    0.000    0.813    0.598
   .v6T3   (C6T13)    0.571    0.177    3.232    0.001    0.571    0.499
 .v6T2 ~~                                                               
   .v6T3    (C6T2)    0.522    0.134    3.902    0.000    0.522    0.575
  Time1 ~~                                                              
    Time2             0.841    0.078   10.747    0.000    0.787    0.787
    Time3             0.681    0.122    5.582    0.000    0.706    0.706
  Time2 ~~                                                              
    Time3             0.695    0.125    5.554    0.000    0.674    0.674

Intercepts:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .v1T1    (I1T1)   16.090    0.274   58.695    0.000   16.090    4.935
   .v2T1    (I2T1)    8.672    0.294   29.525    0.000    8.672    2.446
   .v3T1      (I3)   12.100    0.226   53.558    0.000   12.100    4.719
   .v4T1      (I4)   -3.329    0.254  -13.103    0.000   -3.329   -1.022
   .v5T1      (I5)   -1.193    0.124   -9.630    0.000   -1.193   -0.726
   .v6T1      (I6)   -2.699    0.166  -16.286    0.000   -2.699   -1.350
   .v1T2      (I1)   16.738    0.275   60.784    0.000   16.738    5.696
   .v2T2      (I2)    9.645    0.261   36.936    0.000    9.645    3.000
   .v3T2      (I3)   12.100    0.226   53.558    0.000   12.100    4.633
   .v4T2      (I4)   -3.329    0.254  -13.103    0.000   -3.329   -1.025
   .v5T2      (I5)   -1.193    0.124   -9.630    0.000   -1.193   -0.483
   .v6T2      (I6)   -2.699    0.166  -16.286    0.000   -2.699   -1.405
   .v1T3      (I1)   16.738    0.275   60.784    0.000   16.738    6.287
   .v2T3      (I2)    9.645    0.261   36.936    0.000    9.645    3.257
   .v3T3      (I3)   12.100    0.226   53.558    0.000   12.100    4.895
   .v4T3      (I4)   -3.329    0.254  -13.103    0.000   -3.329   -1.071
   .v5T3      (I5)   -1.193    0.124   -9.630    0.000   -1.193   -0.600
   .v6T3      (I6)   -2.699    0.166  -16.286    0.000   -2.699   -1.589
    Time1             0.000                               0.000    0.000
    Time2             0.171    0.079    2.162    0.031    0.160    0.160
    Time3             0.399    0.080    4.963    0.000    0.413    0.413

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .v1T1    (E1T1)    0.220    0.387    0.568    0.570    0.220    0.021
   .v2T1    (E2T1)    8.663    1.028    8.430    0.000    8.663    0.689
   .v3T1    (E3T1)    2.484    0.406    6.123    0.000    2.484    0.378
   .v4T1    (E4T1)    7.258    1.013    7.163    0.000    7.258    0.684
   .v5T1    (E5T1)    1.841    0.456    4.041    0.000    1.841    0.682
   .v6T1    (E6T1)    1.713    0.253    6.769    0.000    1.713    0.429
   .v1T2    (E1T2)    0.594    0.270    2.203    0.028    0.594    0.069
   .v2T2    (E2T2)    5.864    0.600    9.771    0.000    5.864    0.568
   .v3T2    (E3T2)    2.143    0.352    6.093    0.000    2.143    0.314
   .v4T2    (E4T2)    6.714    0.963    6.972    0.000    6.714    0.637
   .v5T2    (E5T2)    5.115    1.625    3.147    0.002    5.115    0.839
   .v6T2    (E6T2)    1.080    0.164    6.593    0.000    1.080    0.293
   .v1T3    (E1T3)    0.541    0.310    1.743    0.081    0.541    0.076
   .v2T3    (E2T3)    5.132    0.789    6.504    0.000    5.132    0.585
   .v3T3    (E3T3)    2.301    0.419    5.497    0.000    2.301    0.377
   .v4T3    (E4T3)    6.544    1.123    5.828    0.000    6.544    0.678
   .v5T3    (E5T3)    3.145    0.863    3.644    0.000    3.145    0.797
   .v6T3    (E6T3)    0.762    0.169    4.498    0.000    0.762    0.264
    Time1             1.000                               1.000    1.000
    Time2             1.143    0.183    6.261    0.000    1.000    1.000
    Time3             0.931    0.153    6.089    0.000    1.000    1.000

R-Square:
                   Estimate
    v1T1              0.979
    v2T1              0.311
    v3T1              0.622
    v4T1              0.316
    v5T1              0.318
    v6T1              0.571
    v1T2              0.931
    v2T2              0.432
    v3T2              0.686
    v4T2              0.363
    v5T2              0.161
    v6T2              0.707
    v1T3              0.924
    v2T3              0.415
    v3T3              0.623
    v4T3              0.322
    v5T3              0.203
    v6T3              0.736
anova(metricEstimates2, scalarEstimates2)
Scaled Chi Square Difference Test (method = "satorra.bentler.2001")

                  Df    AIC    BIC  Chisq Chisq diff Df diff Pr(>Chisq)    
metricEstimates2 123 9003.3 9202.5 303.25                                  
scalarEstimates2 131 9023.4 9198.4 339.32     39.321       8  4.285e-06 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
anova(configuralEstimates, scalarEstimates2)
Scaled Chi Square Difference Test (method = "satorra.bentler.2001")

                     Df    AIC    BIC  Chisq Chisq diff Df diff Pr(>Chisq)    
configuralEstimates 114 9010.6 9236.9 292.51                                  
scalarEstimates2    131 9023.4 9198.4 339.32     43.975      17  0.0003454 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Does the partial scalar model fit worse than the partial metric model? Yes, −2∆LL(df=8) = 39.321, p <.01. A look at the modification indices reveals a number of items with large values. We will pick the intercept from item5 at time2 to free.

#get modification indices for all parameters:
scalarMI2 = modificationindices(scalarEstimates2, free.remove = FALSE, maximum.number = 10000)
#restrict output to only item intercept parameters:
scalarMI2a = scalarMI2[which(scalarMI2$op == "~1"),]
scalarMI2a[order(-scalarMI2a$mi),]
     lhs op rhs     mi mi.scaled    epc sepc.lv sepc.all sepc.nox
29  v5T2 ~1     11.097    10.703 -0.340  -0.340   -0.138   -0.138
23  v5T1 ~1      7.254     6.997  0.202   0.202    0.123    0.123
22  v4T1 ~1      6.089     5.873  0.436   0.436    0.134    0.134
24  v6T1 ~1      4.979     4.802 -0.210  -0.210   -0.105   -0.105
28  v4T2 ~1      3.566     3.440 -0.285  -0.285   -0.088   -0.088
21  v3T1 ~1      1.977     1.907 -0.173  -0.173   -0.068   -0.068
33  v3T3 ~1      1.817     1.753  0.171   0.171    0.069    0.069
30  v6T2 ~1      1.711     1.650  0.096   0.096    0.050    0.050
31  v1T3 ~1      0.886     0.854 -0.095  -0.095   -0.036   -0.036
25  v1T2 ~1      0.833     0.803  0.089   0.089    0.030    0.030
36  v6T3 ~1      0.191     0.184  0.033   0.033    0.019    0.019
35  v5T3 ~1      0.135     0.130 -0.040  -0.040   -0.020   -0.020
34  v4T3 ~1      0.070     0.068 -0.049  -0.049   -0.016   -0.016
27  v3T2 ~1      0.008     0.008  0.010   0.010    0.004    0.004
32  v2T3 ~1      0.000     0.000  0.004   0.004    0.001    0.001
26  v2T2 ~1      0.000     0.000 -0.003  -0.003   -0.001   -0.001
77 Time2 ~1      0.000     0.000  0.000   0.000    0.000    0.000
78 Time3 ~1      0.000     0.000  0.000   0.000    0.000    0.000
19  v1T1 ~1      0.000     0.000  0.000   0.000    0.000    0.000
20  v2T1 ~1      0.000     0.000  0.000   0.000    0.000    0.000
scalarSyntax3 = "
#===================================================================================================
#Factor loadings constrained across groups except non-invariant ones
Time1 =~ L1T1*v1T1 + L2*v2T1 + L3*v3T1 + L4*v4T1 + L5*v5T1 + L6*v6T1
Time2 =~ L1*v1T2 + L2*v2T2 + L3*v3T2 + L4*v4T2 + L5*v5T2 + L6*v6T2
Time3 =~ L1*v1T3 + L2*v2T3 + L3*v3T3 + L4*v4T3 + L5*v5T3 + L6*v6T3
#===================================================================================================
#Item intercepts all constrained across groups except non-invariant ones ****
v1T1 ~ I1T1*1; v2T1 ~ I2T1*1;  v3T1 ~ I3*1; v4T1 ~ I4*1; v5T1 ~ I5*1; v6T1 ~ I6*1; 
v1T2 ~ I1*1;   v2T2 ~ I2*1;  v3T2 ~ I3*1; v4T2 ~ I4*1; v5T2 ~ I5T2*1; v6T2 ~ I6*1; 
v1T3 ~ I1*1;   v2T3 ~ I2*1;  v3T3 ~ I3*1; v4T3 ~ I4*1; v5T3 ~ I5*1; v6T3 ~ I6*1; 
#===================================================================================================
#Redidual variances all freely estimated in each group with labels
v1T1 ~~ E1T1*v1T1; v2T1 ~~ E2T1*v2T1;  v3T1 ~~ E3T1*v3T1; v4T1 ~~ E4T1*v4T1; v5T1 ~~ E5T1*v5T1; v6T1 ~~ E6T1*v6T1;
v1T2 ~~ E1T2*v1T2; v2T2 ~~ E2T2*v2T2;  v3T2 ~~ E3T2*v3T2; v4T2 ~~ E4T2*v4T2; v5T2 ~~ E5T2*v5T2; v6T2 ~~ E6T2*v6T2;
v1T3 ~~ E1T3*v1T3; v2T3 ~~ E2T3*v2T3;  v3T3 ~~ E3T3*v3T3; v4T3 ~~ E4T3*v4T3; v5T3 ~~ E5T3*v5T3; v6T3 ~~ E6T3*v6T3; 
#===================================================================================================
#Residual covariances freely estimated in each group with labels
v1T1 ~~ C1T12*v1T2 + C1T13*v1T3; v1T2 ~~ C1T23*v1T3; 
v2T1 ~~ C2T12*v2T2 + C2T13*v2T3; v2T2 ~~ C2T23*v2T3; 
v3T1 ~~ C3T12*v3T2 + C3T13*v3T3; v3T2 ~~ C3T23*v3T3; 
v4T1 ~~ C4T12*v4T2 + C4T13*v4T3; v4T2 ~~ C4T23*v4T3; 
v5T1 ~~ C5T12*v5T2 + C5T13*v5T3; v5T2 ~~ C5T23*v5T3; 
v6T1 ~~ C6T12*v6T2 + C6T13*v6T3; v6T2 ~~ C6T23*v6T3; 
#===================================================================================================
#Factor variance fixed to 1 for identification in first group; estimated in others
Time1 ~~ 1*Time1
Time2 ~~ Time2
Time3 ~~ Time3
#===================================================================================================
#Factor mean fixed to zero for identification first group, estimated in others ****
Time1 ~ 0
Time2 ~ 1
Time3 ~ 1
#===================================================================================================
#Factor covariances all freely estimated
Time1 ~~ Time2 + Time3
Time2 ~~ Time3 
"
scalarEstimates3 = lavaan(model = scalarSyntax3, data = cafData, estimator = "MLR", mimic = "mplus")
lavaan WARNING: some cases are empty and will be ignored:
  16 58 64 75 76 133 153 156
summary(scalarEstimates3, fit.measures = TRUE, rsquare = TRUE, standardized = TRUE)
lavaan (0.5-23.1097) converged normally after 121 iterations

                                                  Used       Total
  Number of observations                           151         159

  Number of missing patterns                         7

  Estimator                                         ML      Robust
  Minimum Function Test Statistic              324.707     311.362
  Degrees of freedom                               130         130
  P-value (Chi-square)                           0.000       0.000
  Scaling correction factor                                  1.043
    for the Yuan-Bentler correction (Mplus variant)

Model test baseline model:

  Minimum Function Test Statistic             2192.158    1896.786
  Degrees of freedom                               153         153
  P-value                                        0.000       0.000

User model versus baseline model:

  Comparative Fit Index (CFI)                    0.905       0.896
  Tucker-Lewis Index (TLI)                       0.888       0.878

  Robust Comparative Fit Index (CFI)                         0.906
  Robust Tucker-Lewis Index (TLI)                            0.890

Loglikelihood and Information Criteria:

  Loglikelihood user model (H0)              -4446.399   -4446.399
  Scaling correction factor                                  1.162
    for the MLR correction
  Loglikelihood unrestricted model (H1)      -4284.045   -4284.045
  Scaling correction factor                                  1.203
    for the MLR correction

  Number of free parameters                         59          59
  Akaike (AIC)                                9010.798    9010.798
  Bayesian (BIC)                              9188.817    9188.817
  Sample-size adjusted Bayesian (BIC)         9002.088    9002.088

Root Mean Square Error of Approximation:

  RMSEA                                          0.100       0.096
  90 Percent Confidence Interval          0.086  0.113       0.083  0.110
  P-value RMSEA <= 0.05                          0.000       0.000

  Robust RMSEA                                               0.098
  90 Percent Confidence Interval                             0.084  0.112

Standardized Root Mean Square Residual:

  SRMR                                           0.088       0.088

Parameter Estimates:

  Information                                 Observed
  Standard Errors                   Robust.huber.white

Latent Variables:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  Time1 =~                                                              
    v1T1    (L1T1)    3.226    0.263   12.275    0.000    3.226    0.989
    v2T1      (L2)    1.980    0.200    9.888    0.000    1.980    0.558
    v3T1      (L3)    2.021    0.194   10.423    0.000    2.021    0.790
    v4T1      (L4)    1.814    0.231    7.849    0.000    1.814    0.558
    v5T1      (L5)    0.916    0.142    6.456    0.000    0.916    0.561
    v6T1      (L6)    1.513    0.128   11.821    0.000    1.513    0.757
  Time2 =~                                                              
    v1T2      (L1)    2.660    0.231   11.533    0.000    2.840    0.966
    v2T2      (L2)    1.980    0.200    9.888    0.000    2.114    0.657
    v3T2      (L3)    2.021    0.194   10.423    0.000    2.158    0.827
    v4T2      (L4)    1.814    0.231    7.849    0.000    1.937    0.599
    v5T2      (L5)    0.916    0.142    6.456    0.000    0.978    0.412
    v6T2      (L6)    1.513    0.128   11.821    0.000    1.615    0.841
  Time3 =~                                                              
    v1T3      (L1)    2.660    0.231   11.533    0.000    2.561    0.961
    v2T3      (L2)    1.980    0.200    9.888    0.000    1.906    0.644
    v3T3      (L3)    2.021    0.194   10.423    0.000    1.946    0.789
    v4T3      (L4)    1.814    0.231    7.849    0.000    1.747    0.565
    v5T3      (L5)    0.916    0.142    6.456    0.000    0.882    0.449
    v6T3      (L6)    1.513    0.128   11.821    0.000    1.457    0.858

Covariances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
 .v1T1 ~~                                                               
   .v1T2   (C1T12)   -0.201    0.252   -0.796    0.426   -0.201   -0.556
   .v1T3   (C1T13)    0.014    0.241    0.056    0.955    0.014    0.039
 .v1T2 ~~                                                               
   .v1T3    (C1T2)    0.134    0.231    0.579    0.562    0.134    0.239
 .v2T1 ~~                                                               
   .v2T2   (C2T12)    3.951    0.679    5.815    0.000    3.951    0.554
   .v2T3   (C2T13)    2.223    0.799    2.781    0.005    2.223    0.334
 .v2T2 ~~                                                               
   .v2T3    (C2T2)    2.135    0.563    3.790    0.000    2.135    0.389
 .v3T1 ~~                                                               
   .v3T2   (C3T12)    0.992    0.296    3.358    0.001    0.992    0.430
   .v3T3   (C3T13)    1.092    0.292    3.743    0.000    1.092    0.458
 .v3T2 ~~                                                               
   .v3T3    (C3T2)    1.171    0.319    3.671    0.000    1.171    0.526
 .v4T1 ~~                                                               
   .v4T2   (C4T12)    4.635    0.838    5.529    0.000    4.635    0.663
   .v4T3   (C4T13)    3.720    1.019    3.650    0.000    3.720    0.540
 .v4T2 ~~                                                               
   .v4T3    (C4T2)    4.538    0.800    5.675    0.000    4.538    0.686
 .v5T1 ~~                                                               
   .v5T2   (C5T12)    2.342    0.761    3.079    0.002    2.342    0.799
   .v5T3   (C5T13)    1.423    0.446    3.188    0.001    1.423    0.599
 .v5T2 ~~                                                               
   .v5T3    (C5T2)    2.909    0.802    3.629    0.000    2.909    0.765
 .v6T1 ~~                                                               
   .v6T2   (C6T12)    0.820    0.167    4.912    0.000    0.820    0.604
   .v6T3   (C6T13)    0.572    0.176    3.246    0.001    0.572    0.503
 .v6T2 ~~                                                               
   .v6T3    (C6T2)    0.522    0.134    3.902    0.000    0.522    0.575
  Time1 ~~                                                              
    Time2             0.840    0.077   10.902    0.000    0.786    0.786
    Time3             0.679    0.122    5.564    0.000    0.705    0.705
  Time2 ~~                                                              
    Time3             0.692    0.125    5.533    0.000    0.673    0.673

Intercepts:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .v1T1    (I1T1)   16.085    0.275   58.539    0.000   16.085    4.934
   .v2T1    (I2T1)    8.677    0.293   29.587    0.000    8.677    2.446
   .v3T1      (I3)   12.062    0.225   53.554    0.000   12.062    4.712
   .v4T1      (I4)   -3.359    0.259  -12.963    0.000   -3.359   -1.033
   .v5T1      (I5)   -1.353    0.141   -9.604    0.000   -1.353   -0.828
   .v6T1      (I6)   -2.735    0.165  -16.560    0.000   -2.735   -1.369
   .v1T2      (I1)   16.664    0.276   60.330    0.000   16.664    5.667
   .v2T2      (I2)    9.589    0.261   36.774    0.000    9.589    2.982
   .v3T2      (I3)   12.062    0.225   53.554    0.000   12.062    4.622
   .v4T2      (I4)   -3.359    0.259  -12.963    0.000   -3.359   -1.039
   .v5T2    (I5T2)   -1.779    0.214   -8.299    0.000   -1.779   -0.748
   .v6T2      (I6)   -2.735    0.165  -16.560    0.000   -2.735   -1.423
   .v1T3      (I1)   16.664    0.276   60.330    0.000   16.664    6.254
   .v2T3      (I2)    9.589    0.261   36.774    0.000    9.589    3.240
   .v3T3      (I3)   12.062    0.225   53.554    0.000   12.062    4.887
   .v4T3      (I4)   -3.359    0.259  -12.963    0.000   -3.359   -1.086
   .v5T3      (I5)   -1.353    0.141   -9.604    0.000   -1.353   -0.689
   .v6T3      (I6)   -2.735    0.165  -16.560    0.000   -2.735   -1.610
    Time1             0.000                               0.000    0.000
    Time2             0.205    0.076    2.691    0.007    0.192    0.192
    Time3             0.419    0.080    5.223    0.000    0.435    0.435

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .v1T1    (E1T1)    0.225    0.386    0.583    0.560    0.225    0.021
   .v2T1    (E2T1)    8.663    1.029    8.419    0.000    8.663    0.688
   .v3T1    (E3T1)    2.468    0.398    6.200    0.000    2.468    0.377
   .v4T1    (E4T1)    7.281    1.016    7.169    0.000    7.281    0.689
   .v5T1    (E5T1)    1.831    0.442    4.140    0.000    1.831    0.686
   .v6T1    (E6T1)    1.703    0.249    6.832    0.000    1.703    0.427
   .v1T2    (E1T2)    0.580    0.269    2.158    0.031    0.580    0.067
   .v2T2    (E2T2)    5.872    0.601    9.773    0.000    5.872    0.568
   .v3T2    (E3T2)    2.154    0.352    6.111    0.000    2.154    0.316
   .v4T2    (E4T2)    6.706    0.962    6.973    0.000    6.706    0.641
   .v5T2    (E5T2)    4.691    1.426    3.290    0.001    4.691    0.831
   .v6T2    (E6T2)    1.082    0.164    6.582    0.000    1.082    0.293
   .v1T3    (E1T3)    0.538    0.314    1.714    0.087    0.538    0.076
   .v2T3    (E2T3)    5.126    0.788    6.506    0.000    5.126    0.585
   .v3T3    (E3T3)    2.304    0.418    5.507    0.000    2.304    0.378
   .v4T3    (E4T3)    6.524    1.117    5.839    0.000    6.524    0.681
   .v5T3    (E5T3)    3.080    0.833    3.699    0.000    3.080    0.798
   .v6T3    (E6T3)    0.762    0.168    4.522    0.000    0.762    0.264
    Time1             1.000                               1.000    1.000
    Time2             1.140    0.179    6.374    0.000    1.000    1.000
    Time3             0.927    0.154    6.028    0.000    1.000    1.000

R-Square:
                   Estimate
    v1T1              0.979
    v2T1              0.312
    v3T1              0.623
    v4T1              0.311
    v5T1              0.314
    v6T1              0.573
    v1T2              0.933
    v2T2              0.432
    v3T2              0.684
    v4T2              0.359
    v5T2              0.169
    v6T2              0.707
    v1T3              0.924
    v2T3              0.415
    v3T3              0.622
    v4T3              0.319
    v5T3              0.202
    v6T3              0.736
anova(metricEstimates2, scalarEstimates3)
Scaled Chi Square Difference Test (method = "satorra.bentler.2001")

                  Df    AIC    BIC  Chisq Chisq diff Df diff Pr(>Chisq)   
metricEstimates2 123 9003.3 9202.5 303.25                                 
scalarEstimates3 130 9010.8 9188.8 324.71     21.199       7   0.003486 **
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
anova(configuralEstimates, scalarEstimates3)
Scaled Chi Square Difference Test (method = "satorra.bentler.2001")

                     Df    AIC    BIC  Chisq Chisq diff Df diff Pr(>Chisq)  
configuralEstimates 114 9010.6 9236.9 292.51                                
scalarEstimates3    130 9010.8 9188.8 324.71      28.87      16    0.02483 *
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Does the partial scalar model fit worse than the partial metric model? Yes, −2∆LL(df=7) = 21.199, p <.01. A look at the modification indices reveals several items with large values. We will pick the intercept from item4 at time1 to free.

#get modification indices for all parameters:
scalarMI3 = modificationindices(scalarEstimates3, free.remove = FALSE, maximum.number = 10000)
#restrict output to only item intercept parameters:
scalarMI3a = scalarMI3[which(scalarMI3$op == "~1"),]
scalarMI3a[order(-scalarMI3a$mi),]
     lhs op rhs    mi mi.scaled    epc sepc.lv sepc.all sepc.nox
22  v4T1 ~1     7.360     7.057  0.483   0.483    0.148    0.148
28  v4T2 ~1     4.582     4.394 -0.324  -0.324   -0.100   -0.100
35  v5T3 ~1     4.389     4.209 -0.235  -0.235   -0.120   -0.120
24  v6T1 ~1     3.049     2.923 -0.163  -0.163   -0.082   -0.082
23  v5T1 ~1     1.858     1.782  0.099   0.099    0.061    0.061
33  v3T3 ~1     1.838     1.762  0.172   0.172    0.070    0.070
21  v3T1 ~1     1.004     0.963 -0.123  -0.123   -0.048   -0.048
30  v6T2 ~1     0.749     0.718  0.063   0.063    0.033    0.033
31  v1T3 ~1     0.273     0.262 -0.053  -0.053   -0.020   -0.020
36  v6T3 ~1     0.260     0.250  0.038   0.038    0.022    0.022
25  v1T2 ~1     0.255     0.245  0.049   0.049    0.017    0.017
27  v3T2 ~1     0.078     0.075 -0.031  -0.031   -0.012   -0.012
34  v4T3 ~1     0.042     0.040 -0.038  -0.038   -0.012   -0.012
32  v2T3 ~1     0.011     0.011  0.021   0.021    0.007    0.007
26  v2T2 ~1     0.008     0.008 -0.015  -0.015   -0.005   -0.005
29  v5T2 ~1     0.000     0.000  0.000   0.000    0.000    0.000
19  v1T1 ~1     0.000     0.000  0.000   0.000    0.000    0.000
77 Time2 ~1     0.000     0.000  0.000   0.000    0.000    0.000
78 Time3 ~1     0.000     0.000  0.000   0.000    0.000    0.000
20  v2T1 ~1     0.000     0.000  0.000   0.000    0.000    0.000
scalarSyntax4 = "
#===================================================================================================
#Factor loadings constrained across groups except non-invariant ones
Time1 =~ L1T1*v1T1 + L2*v2T1 + L3*v3T1 + L4*v4T1 + L5*v5T1 + L6*v6T1
Time2 =~ L1*v1T2 + L2*v2T2 + L3*v3T2 + L4*v4T2 + L5*v5T2 + L6*v6T2
Time3 =~ L1*v1T3 + L2*v2T3 + L3*v3T3 + L4*v4T3 + L5*v5T3 + L6*v6T3
#===================================================================================================
#Item intercepts all constrained across groups except non-invariant ones ****
v1T1 ~ I1T1*1; v2T1 ~ I2T1*1;  v3T1 ~ I3*1; v4T1 ~ I4T1*1; v5T1 ~ I5*1; v6T1 ~ I6*1; 
v1T2 ~ I1*1;   v2T2 ~ I2*1;  v3T2 ~ I3*1; v4T2 ~ I4*1; v5T2 ~ I5T2*1; v6T2 ~ I6*1; 
v1T3 ~ I1*1;   v2T3 ~ I2*1;  v3T3 ~ I3*1; v4T3 ~ I4*1; v5T3 ~ I5*1; v6T3 ~ I6*1; 
#===================================================================================================
#Redidual variances all freely estimated in each group with labels
v1T1 ~~ E1T1*v1T1; v2T1 ~~ E2T1*v2T1;  v3T1 ~~ E3T1*v3T1; v4T1 ~~ E4T1*v4T1; v5T1 ~~ E5T1*v5T1; v6T1 ~~ E6T1*v6T1;
v1T2 ~~ E1T2*v1T2; v2T2 ~~ E2T2*v2T2;  v3T2 ~~ E3T2*v3T2; v4T2 ~~ E4T2*v4T2; v5T2 ~~ E5T2*v5T2; v6T2 ~~ E6T2*v6T2;
v1T3 ~~ E1T3*v1T3; v2T3 ~~ E2T3*v2T3;  v3T3 ~~ E3T3*v3T3; v4T3 ~~ E4T3*v4T3; v5T3 ~~ E5T3*v5T3; v6T3 ~~ E6T3*v6T3;
#===================================================================================================
#Residual covariances freely estimated in each group with labels
v1T1 ~~ C1T12*v1T2 + C1T13*v1T3; v1T2 ~~ C1T23*v1T3; 
v2T1 ~~ C2T12*v2T2 + C2T13*v2T3; v2T2 ~~ C2T23*v2T3; 
v3T1 ~~ C3T12*v3T2 + C3T13*v3T3; v3T2 ~~ C3T23*v3T3; 
v4T1 ~~ C4T12*v4T2 + C4T13*v4T3; v4T2 ~~ C4T23*v4T3; 
v5T1 ~~ C5T12*v5T2 + C5T13*v5T3; v5T2 ~~ C5T23*v5T3; 
v6T1 ~~ C6T12*v6T2 + C6T13*v6T3; v6T2 ~~ C6T23*v6T3; 
#===================================================================================================
#Factor variance fixed to 1 for identification in first group; estimated in others
Time1 ~~ 1*Time1
Time2 ~~ Time2
Time3 ~~ Time3
#===================================================================================================
#Factor mean fixed to zero for identification first group, estimated in others ****
Time1 ~ 0
Time2 ~ 1
Time3 ~ 1
#===================================================================================================
#Factor covariances all freely estimated
Time1 ~~ Time2 + Time3
Time2 ~~ Time3 
"
scalarEstimates4 = lavaan(model = scalarSyntax4, data = cafData, estimator = "MLR", mimic = "mplus")
lavaan WARNING: some cases are empty and will be ignored:
  16 58 64 75 76 133 153 156
summary(scalarEstimates4, fit.measures = TRUE, rsquare = TRUE, standardized = TRUE)
lavaan (0.5-23.1097) converged normally after 110 iterations

                                                  Used       Total
  Number of observations                           151         159

  Number of missing patterns                         7

  Estimator                                         ML      Robust
  Minimum Function Test Statistic              314.564     302.389
  Degrees of freedom                               129         129
  P-value (Chi-square)                           0.000       0.000
  Scaling correction factor                                  1.040
    for the Yuan-Bentler correction (Mplus variant)

Model test baseline model:

  Minimum Function Test Statistic             2192.158    1896.786
  Degrees of freedom                               153         153
  P-value                                        0.000       0.000

User model versus baseline model:

  Comparative Fit Index (CFI)                    0.909       0.901
  Tucker-Lewis Index (TLI)                       0.892       0.882

  Robust Comparative Fit Index (CFI)                         0.911
  Robust Tucker-Lewis Index (TLI)                            0.894

Loglikelihood and Information Criteria:

  Loglikelihood user model (H0)              -4441.327   -4441.327
  Scaling correction factor                                  1.179
    for the MLR correction
  Loglikelihood unrestricted model (H1)      -4284.045   -4284.045
  Scaling correction factor                                  1.203
    for the MLR correction

  Number of free parameters                         60          60
  Akaike (AIC)                                9002.655    9002.655
  Bayesian (BIC)                              9183.692    9183.692
  Sample-size adjusted Bayesian (BIC)         8993.798    8993.798

Root Mean Square Error of Approximation:

  RMSEA                                          0.098       0.094
  90 Percent Confidence Interval          0.084  0.111       0.081  0.108
  P-value RMSEA <= 0.05                          0.000       0.000

  Robust RMSEA                                               0.096
  90 Percent Confidence Interval                             0.082  0.110

Standardized Root Mean Square Residual:

  SRMR                                           0.092       0.092

Parameter Estimates:

  Information                                 Observed
  Standard Errors                   Robust.huber.white

Latent Variables:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  Time1 =~                                                              
    v1T1    (L1T1)    3.226    0.262   12.322    0.000    3.226    0.990
    v2T1      (L2)    1.977    0.200    9.905    0.000    1.977    0.558
    v3T1      (L3)    2.009    0.194   10.340    0.000    2.009    0.788
    v4T1      (L4)    1.916    0.226    8.490    0.000    1.916    0.582
    v5T1      (L5)    0.906    0.141    6.424    0.000    0.906    0.556
    v6T1      (L6)    1.505    0.127   11.899    0.000    1.505    0.756
  Time2 =~                                                              
    v1T2      (L1)    2.664    0.231   11.557    0.000    2.843    0.966
    v2T2      (L2)    1.977    0.200    9.905    0.000    2.110    0.656
    v3T2      (L3)    2.009    0.194   10.340    0.000    2.143    0.824
    v4T2      (L4)    1.916    0.226    8.490    0.000    2.045    0.618
    v5T2      (L5)    0.906    0.141    6.424    0.000    0.967    0.408
    v6T2      (L6)    1.505    0.127   11.899    0.000    1.606    0.839
  Time3 =~                                                              
    v1T3      (L1)    2.664    0.231   11.557    0.000    2.562    0.962
    v2T3      (L2)    1.977    0.200    9.905    0.000    1.902    0.643
    v3T3      (L3)    2.009    0.194   10.340    0.000    1.932    0.786
    v4T3      (L4)    1.916    0.226    8.490    0.000    1.843    0.583
    v5T3      (L5)    0.906    0.141    6.424    0.000    0.871    0.443
    v6T3      (L6)    1.505    0.127   11.899    0.000    1.448    0.855

Covariances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
 .v1T1 ~~                                                               
   .v1T2   (C1T12)   -0.204    0.251   -0.814    0.416   -0.204   -0.578
   .v1T3   (C1T13)    0.015    0.240    0.061    0.951    0.015    0.043
 .v1T2 ~~                                                               
   .v1T3    (C1T2)    0.134    0.231    0.580    0.562    0.134    0.243
 .v2T1 ~~                                                               
   .v2T2   (C2T12)    3.954    0.679    5.820    0.000    3.954    0.554
   .v2T3   (C2T13)    2.222    0.798    2.784    0.005    2.222    0.333
 .v2T2 ~~                                                               
   .v2T3    (C2T2)    2.133    0.564    3.782    0.000    2.133    0.388
 .v3T1 ~~                                                               
   .v3T2   (C3T12)    0.994    0.294    3.382    0.001    0.994    0.431
   .v3T3   (C3T13)    1.105    0.290    3.813    0.000    1.105    0.464
 .v3T2 ~~                                                               
   .v3T3    (C3T2)    1.168    0.319    3.663    0.000    1.168    0.523
 .v4T1 ~~                                                               
   .v4T2   (C4T12)    4.809    0.851    5.649    0.000    4.809    0.691
   .v4T3   (C4T13)    3.881    1.032    3.762    0.000    3.881    0.564
 .v4T2 ~~                                                               
   .v4T3    (C4T2)    4.657    0.831    5.602    0.000    4.657    0.697
 .v5T1 ~~                                                               
   .v5T2   (C5T12)    2.344    0.761    3.081    0.002    2.344    0.799
   .v5T3   (C5T13)    1.423    0.448    3.174    0.002    1.423    0.596
 .v5T2 ~~                                                               
   .v5T3    (C5T2)    2.918    0.805    3.627    0.000    2.918    0.764
 .v6T1 ~~                                                               
   .v6T2   (C6T12)    0.826    0.165    5.019    0.000    0.826    0.609
   .v6T3   (C6T13)    0.579    0.176    3.293    0.001    0.579    0.507
 .v6T2 ~~                                                               
   .v6T3    (C6T2)    0.525    0.134    3.933    0.000    0.525    0.576
  Time1 ~~                                                              
    Time2             0.838    0.077   10.916    0.000    0.786    0.786
    Time3             0.677    0.123    5.525    0.000    0.704    0.704
  Time2 ~~                                                              
    Time3             0.689    0.126    5.491    0.000    0.672    0.672

Intercepts:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .v1T1    (I1T1)   16.084    0.275   58.538    0.000   16.084    4.933
   .v2T1    (I2T1)    8.678    0.293   29.586    0.000    8.678    2.447
   .v3T1      (I3)   11.996    0.222   53.986    0.000   11.996    4.707
   .v4T1    (I4T1)   -3.020    0.267  -11.307    0.000   -3.020   -0.917
   .v5T1      (I5)   -1.360    0.142   -9.574    0.000   -1.360   -0.835
   .v6T1      (I6)   -2.802    0.161  -17.432    0.000   -2.802   -1.408
   .v1T2      (I1)   16.526    0.273   60.493    0.000   16.526    5.618
   .v2T2      (I2)    9.489    0.257   36.850    0.000    9.489    2.952
   .v3T2      (I3)   11.996    0.222   53.986    0.000   11.996    4.615
   .v4T2      (I4)   -3.668    0.284  -12.896    0.000   -3.668   -1.109
   .v5T2    (I5T2)   -1.816    0.219   -8.277    0.000   -1.816   -0.766
   .v6T2      (I6)   -2.802    0.161  -17.432    0.000   -2.802   -1.464
   .v1T3      (I1)   16.526    0.273   60.493    0.000   16.526    6.203
   .v2T3      (I2)    9.489    0.257   36.850    0.000    9.489    3.208
   .v3T3      (I3)   11.996    0.222   53.986    0.000   11.996    4.884
   .v4T3      (I4)   -3.668    0.284  -12.896    0.000   -3.668   -1.159
   .v5T3      (I5)   -1.360    0.142   -9.574    0.000   -1.360   -0.692
   .v6T3      (I6)   -2.802    0.161  -17.432    0.000   -2.802   -1.656
    Time1             0.000                               0.000    0.000
    Time2             0.257    0.075    3.432    0.001    0.241    0.241
    Time3             0.468    0.085    5.506    0.000    0.487    0.487

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .v1T1    (E1T1)    0.219    0.377    0.580    0.562    0.219    0.021
   .v2T1    (E2T1)    8.669    1.027    8.437    0.000    8.669    0.689
   .v3T1    (E3T1)    2.462    0.387    6.362    0.000    2.462    0.379
   .v4T1    (E4T1)    7.173    1.023    7.014    0.000    7.173    0.661
   .v5T1    (E5T1)    1.833    0.443    4.142    0.000    1.833    0.691
   .v6T1    (E6T1)    1.696    0.244    6.960    0.000    1.696    0.428
   .v1T2    (E1T2)    0.571    0.267    2.139    0.032    0.571    0.066
   .v2T2    (E2T2)    5.882    0.603    9.751    0.000    5.882    0.569
   .v3T2    (E3T2)    2.163    0.352    6.145    0.000    2.163    0.320
   .v4T2    (E4T2)    6.761    0.970    6.967    0.000    6.761    0.618
   .v5T2    (E5T2)    4.693    1.424    3.296    0.001    4.693    0.834
   .v6T2    (E6T2)    1.084    0.164    6.600    0.000    1.084    0.296
   .v1T3    (E1T3)    0.532    0.316    1.685    0.092    0.532    0.075
   .v2T3    (E2T3)    5.134    0.788    6.513    0.000    5.134    0.587
   .v3T3    (E3T3)    2.303    0.416    5.534    0.000    2.303    0.382
   .v4T3    (E4T3)    6.610    1.131    5.844    0.000    6.610    0.661
   .v5T3    (E5T3)    3.106    0.841    3.692    0.000    3.106    0.804
   .v6T3    (E6T3)    0.768    0.169    4.540    0.000    0.768    0.268
    Time1             1.000                               1.000    1.000
    Time2             1.138    0.178    6.395    0.000    1.000    1.000
    Time3             0.925    0.154    6.024    0.000    1.000    1.000

R-Square:
                   Estimate
    v1T1              0.979
    v2T1              0.311
    v3T1              0.621
    v4T1              0.339
    v5T1              0.309
    v6T1              0.572
    v1T2              0.934
    v2T2              0.431
    v3T2              0.680
    v4T2              0.382
    v5T2              0.166
    v6T2              0.704
    v1T3              0.925
    v2T3              0.413
    v3T3              0.618
    v4T3              0.339
    v5T3              0.196
    v6T3              0.732
anova(metricEstimates2, scalarEstimates4)
Scaled Chi Square Difference Test (method = "satorra.bentler.2001")

                  Df    AIC    BIC  Chisq Chisq diff Df diff Pr(>Chisq)  
metricEstimates2 123 9003.3 9202.5 303.25                                
scalarEstimates4 129 9002.7 9183.7 314.56     11.895       6    0.06435 .
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
anova(configuralEstimates, scalarEstimates4)
Scaled Chi Square Difference Test (method = "satorra.bentler.2001")

                     Df    AIC    BIC  Chisq Chisq diff Df diff Pr(>Chisq)
configuralEstimates 114 9010.6 9236.9 292.51                              
scalarEstimates4    129 9002.7 9183.7 314.56     20.089      15     0.1685

We finally see our likelihood ratio test cooperate and consider this to be the model to move forward with. Next is testing residual invariance.

Residual Variance Invariance Model (error variances held equal for all except non-invariant items)

residVarSyntax1 = "
#===================================================================================================
#Factor loadings constrained across groups except non-invariant ones
Time1 =~ L1T1*v1T1 + L2*v2T1 + L3*v3T1 + L4*v4T1 + L5*v5T1 + L6*v6T1
Time2 =~ L1*v1T2 + L2*v2T2 + L3*v3T2 + L4*v4T2 + L5*v5T2 + L6*v6T2
Time3 =~ L1*v1T3 + L2*v2T3 + L3*v3T3 + L4*v4T3 + L5*v5T3 + L6*v6T3
#===================================================================================================
#Item intercepts all constrained across groups except non-invariant ones
v1T1 ~ I1T1*1; v2T1 ~ I2T1*1;  v3T1 ~ I3*1; v4T1 ~ I4T1*1; v5T1 ~ I5*1; v6T1 ~ I6*1; 
v1T2 ~ I1*1;   v2T2 ~ I2*1;  v3T2 ~ I3*1; v4T2 ~ I4*1; v5T2 ~ I5T2*1; v6T2 ~ I6*1; 
v1T3 ~ I1*1;   v2T3 ~ I2*1;  v3T3 ~ I3*1; v4T3 ~ I4*1; v5T3 ~ I5*1; v6T3 ~ I6*1; 
#===================================================================================================
#Redidual variances all constrained in each group except non-invariant ones ****
v1T1 ~~ E1T1*v1T1; v2T1 ~~ E2T1*v2T1;  v3T1 ~~ E3*v3T1; v4T1 ~~ E4T1*v4T1; v5T1 ~~ E5*v5T1; v6T1 ~~ E6*v6T1;
v1T2 ~~ E1*v1T2; v2T2 ~~ E2*v2T2;  v3T2 ~~ E3*v3T2; v4T2 ~~ E4*v4T2; v5T2 ~~ E5T2*v5T2; v6T2 ~~ E6*v6T2;
v1T3 ~~ E1*v1T3; v2T3 ~~ E2*v2T3;  v3T3 ~~ E3*v3T3; v4T3 ~~ E4*v4T3; v5T3 ~~ E5*v5T3; v6T3 ~~ E6*v6T3;
#===================================================================================================
#Residual covariances freely estimated in each group with labels
v1T1 ~~ C1T12*v1T2 + C1T13*v1T3; v1T2 ~~ C1T23*v1T3; 
v2T1 ~~ C2T12*v2T2 + C2T13*v2T3; v2T2 ~~ C2T23*v2T3; 
v3T1 ~~ C3T12*v3T2 + C3T13*v3T3; v3T2 ~~ C3T23*v3T3; 
v4T1 ~~ C4T12*v4T2 + C4T13*v4T3; v4T2 ~~ C4T23*v4T3; 
v5T1 ~~ C5T12*v5T2 + C5T13*v5T3; v5T2 ~~ C5T23*v5T3; 
v6T1 ~~ C6T12*v6T2 + C6T13*v6T3; v6T2 ~~ C6T23*v6T3; 
#===================================================================================================
#Factor variance fixed to 1 for identification in first group; estimated in others
Time1 ~~ 1*Time1
Time2 ~~ Time2
Time3 ~~ Time3
#===================================================================================================
#Factor mean fixed to zero for identification first group, estimated in others
Time1 ~ 0
Time2 ~ 1
Time3 ~ 1
#===================================================================================================
#Factor covariances all freely estimated
Time1 ~~ Time2 + Time3
Time2 ~~ Time3 
"
residVarEstimates1 = lavaan(model = residVarSyntax1, data = cafData, estimator = "MLR", mimic = "mplus")
lavaan WARNING: some cases are empty and will be ignored:
  16 58 64 75 76 133 153 156
summary(residVarEstimates1, fit.measures = TRUE, rsquare = TRUE, standardized = TRUE)