Structural Equation Modeling | Exercise 3

1 What we are going to cover

  1. Ex.1 – Measurement equivalence
  2. Ex.2 – Multi-group mediation analysis

2 Data

The data set used throughout is the European Social Survey ESS4-2008 Edition 4.5 was released on 1 December 2018. We will restrict the analysis to the Belgian case. Each line in the data set represents a Belgian respondent. The full dataset an documentation can be found on the ESS website

Codebook:

  • gvslvol Standard of living for the old, governments’ responsibility (0 Not governments’ responsibility at all - 10 Entirely governments’ responsibility)

  • gvslvue Standard of living for the unemployed, governments’ responsibility (0 Not governments’ responsibility at all - 10 Entirely governments’ responsibility)

  • gvhlthc Health care for the sick, governments’ responsibility (0 Not governments’ responsibility at all - 10 Entirely governments’ responsibility)

  • gvcldcr Child care services for working parents, governments’ responsibility (0 Not governments’ responsibility at all - 10 Entirely governments’ responsibility)

  • gvjbevn Job for everyone, governments’ responsibility (0 Not governments’ responsibility at all - 10 Entirely governments’ responsibility)

  • gvpdlwk Paid leave from work to care for sick family, governments’ responsibility (0 Not governments’ responsibility at all - 10 Entirely governments’ responsibility)

  • sbstrec Social benefits/services place too great strain on economy (1 Agree strongly - 5 Disagree strongly)

  • sbbsntx Social benefits/services cost businesses too much in taxes/charges (1 Agree strongly - 5 Disagree strongly)

  • sbprvpv Social benefits/services prevent widespread poverty (1 Agree strongly - 5 Disagree strongly)

  • sbeqsoc Social benefits/services lead to a more equal society (1 Agree strongly - 5 Disagree strongly)

  • sbcwkfm Social benefits/services make it easier to combine work and family (1 Agree strongly - 5 Disagree strongly)

  • sblazy Social benefits/services make people lazy (1 Agree strongly - 5 Disagree strongly)

  • sblwcoa Social benefits/services make people less willing care for one another (1 Agree strongly - 5 Disagree strongly)

  • sblwlka Social benefits/services make people less willing look after themselves/family (1 Agree strongly - 5 Disagree strongly)

In addition, we will use some other variables

  • agea Respondent’s age

  • eduyrs Years of full-time education completed

  • gndr Gender (1 Male, 2 Female)

  • hinctnta Household’s total net income, all sources (Deciles of the actual household income range in Belgium)

  • gincdif Government should reduce differences in income levels (1 Agree strongly - 5 Disagree strongly)

  • dfincac Large differences in income acceptable to reward talents and efforts (1 Agree strongly - 5 Disagree strongly)

  • smdfslv For fair society, differences in standard of living should be small (1 Agree strongly - 5 Disagree strongly)

3 Environment preparation

First, let’s load the necessary packages to load, manipulate, visualize and analyse the data.

# Uncomment this once if you need to install the packages on your system 

### DATA MANIPULATION ###
# install.packages("haven")                 # data import from spss
# install.packages("dplyr")                 # data manipulation
# install.packages("psych")                 # descriptives
# install.packages("stringr")               # string manipulation
# install.packages("purrr")                 # table manipulation 

### MODELING ###
# install.packages("lavaan")                # SEM modelling

### VISUALIZATION ###
# install.packages("tidySEM")               # plotting SEM models

# Load the packages 

### DATA MANIPULATION ###
library("haven")        
library("dplyr")      
library("psych")
library('stringr')

### MODELING ###
library("lavaan")       

### VISUALIZATION ###
library("tidySEM")
library("purrr")  

4 Ex.1 – Measurement equivalence

  1. Manually specify a configural invariance model for male and female
  2. Manually specify a configural invariance model where you estimate residual covariances for the manifest indicators
  3. Manually specify a metric invariance model for male and female
  4. Manually specify a scalar invariance model for male and female
  5. Explain differences in Degrees of Freedom for all the fitted models
  6. Add gvcldcr and see if the model reaches scalar invariance
  7. Request modification indices for the gvcldcr scalar model and interpret them (OPTIONAL)

Configural invariance model

ess_df <- haven::read_sav("https://github.com/albertostefanelli/SEM_labs/raw/master/data/ESS4_belgium.sav")

# lavaan requires the grouping variable to be a factor 
# gender is coded as 1 Male, 2 Female
ess_df$gndr <- factor(ess_df$gndr,
                      levels = c("1", "2"),         # levels 
                      labels = c("Male", "Female")) # labels 


model_ws_config <-'
# Factor loadings all freely estimated for each group (marker fixed to 1 by defult)
welf_supp =~ gvslvol + gvslvue + gvhlthc

# Item intercepts all freely estimated for each group
gvslvol ~ 1 
gvslvue ~ 1 
gvhlthc ~ 1 

# Residual variances all freely estimated for each group
gvslvol ~~ gvslvol 
gvslvue ~~ gvslvue 
gvhlthc ~~ gvhlthc

# Factor mean (intercept) fixed to zero in each group
welf_supp ~ 0

'


fit_configural <- cfa(model_ws_config, 
                      data = ess_df,
                      group = "gndr")


summary(fit_configural, 
        standardized=TRUE, 
        fit.measures = TRUE
)
lavaan 0.6-10 ended normally after 51 iterations

  Estimator                                         ML
  Optimization method                           NLMINB
  Number of model parameters                        18
                                                      
  Number of observations per group:               Used       Total
    Male                                           861         864
    Female                                         891         896
                                                                  
Model Test User Model:
                                                      
  Test statistic                                 0.000
  Degrees of freedom                                 0
  Test statistic for each group:
    Male                                         0.000
    Female                                       0.000

Model Test Baseline Model:

  Test statistic                              1066.962
  Degrees of freedom                                 6
  P-value                                        0.000

User Model versus Baseline Model:

  Comparative Fit Index (CFI)                    1.000
  Tucker-Lewis Index (TLI)                       1.000

Loglikelihood and Information Criteria:

  Loglikelihood user model (H0)              -9425.388
  Loglikelihood unrestricted model (H1)             NA
                                                      
  Akaike (AIC)                               18886.776
  Bayesian (BIC)                             18985.209
  Sample-size adjusted Bayesian (BIC)        18928.025

Root Mean Square Error of Approximation:

  RMSEA                                          0.000
  90 Percent confidence interval - lower         0.000
  90 Percent confidence interval - upper         0.000
  P-value RMSEA <= 0.05                             NA

Standardized Root Mean Square Residual:

  SRMR                                           0.000

Parameter Estimates:

  Standard errors                             Standard
  Information                                 Expected
  Information saturated (h1) model          Structured


Group 1 [Male]:

Latent Variables:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  welf_supp =~                                                          
    gvslvol           1.000                               1.215    0.802
    gvslvue           0.657    0.067    9.780    0.000    0.799    0.399
    gvhlthc           0.974    0.087   11.183    0.000    1.183    0.805

Intercepts:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .gvslvol           7.851    0.052  152.113    0.000    7.851    5.184
   .gvslvue           6.005    0.068   88.020    0.000    6.005    3.000
   .gvhlthc           8.057    0.050  160.839    0.000    8.057    5.481
    welf_supp         0.000                               0.000    0.000

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .gvslvol           0.817    0.130    6.271    0.000    0.817    0.356
   .gvslvue           3.369    0.171   19.702    0.000    3.369    0.841
   .gvhlthc           0.760    0.123    6.161    0.000    0.760    0.352
    welf_supp         1.477    0.162    9.142    0.000    1.000    1.000


Group 2 [Female]:

Latent Variables:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  welf_supp =~                                                          
    gvslvol           1.000                               1.259    0.869
    gvslvue           0.523    0.068    7.706    0.000    0.659    0.360
    gvhlthc           0.801    0.090    8.906    0.000    1.008    0.685

Intercepts:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .gvslvol           7.892    0.049  162.542    0.000    7.892    5.445
   .gvslvue           6.112    0.061   99.650    0.000    6.112    3.338
   .gvhlthc           8.007    0.049  162.306    0.000    8.007    5.437
    welf_supp         0.000                               0.000    0.000

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .gvslvol           0.514    0.171    3.008    0.003    0.514    0.245
   .gvslvue           2.918    0.146   20.011    0.000    2.918    0.870
   .gvhlthc           1.151    0.121    9.480    0.000    1.151    0.531
    welf_supp         1.586    0.195    8.141    0.000    1.000    1.000

Configural invariance model with residual covariances

model_ws_config_cov <-'
# Factor loadings all freely estimated for each group (marker fixed to 1 by defult)
welf_supp =~ gvslvol + gvslvue + gvhlthc

# Item intercepts all freely estimated for each group
gvslvol ~ 1 
gvslvue ~ 1 
gvhlthc ~ 1 

# Residual variances all freely estimated for each group
gvslvol ~~ gvslvol 
gvslvue ~~ gvslvue 
gvhlthc ~~ gvhlthc

# Residual covariance all freely estimated for each group
gvslvol ~~ gvslvue
gvslvol ~~ gvhlthc
gvslvue ~~ gvhlthc

# Factor mean (intercept) fixed to zero in each group
welf_supp ~ 0

'


fit_configural_cov <- cfa(model_ws_config_cov, 
                      data = ess_df,
                      group = "gndr")


summary(fit_configural_cov,
        standardized=TRUE, 
        fit.measures = TRUE
)
lavaan 0.6-10 ended normally after 34 iterations

  Estimator                                         ML
  Optimization method                           NLMINB
  Number of model parameters                        24
                                                      
  Number of observations per group:               Used       Total
    Male                                           861         864
    Female                                         891         896
                                                                  
Model Test User Model:
                                                      
  Test statistic                                    NA
  Degrees of freedom                                -6
  P-value (Unknown)                                 NA
  Test statistic for each group:
    Male                                            NA
    Female                                          NA

User Model versus Baseline Model:

  Comparative Fit Index (CFI)                       NA
  Tucker-Lewis Index (TLI)                          NA

Loglikelihood and Information Criteria:

  Loglikelihood user model (H0)              -9425.388
  Loglikelihood unrestricted model (H1)             NA
                                                      
  Akaike (AIC)                               18898.776
  Bayesian (BIC)                             19030.020
  Sample-size adjusted Bayesian (BIC)        18953.774

Root Mean Square Error of Approximation:

  RMSEA                                             NA
  90 Percent confidence interval - lower            NA
  90 Percent confidence interval - upper            NA
  P-value RMSEA <= 0.05                             NA

Standardized Root Mean Square Residual:

  SRMR                                           0.000

Parameter Estimates:

  Standard errors                             Standard
  Information                                 Expected
  Information saturated (h1) model          Structured


Group 1 [Male]:

Latent Variables:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  welf_supp =~                                                          
    gvslvol           1.000                               0.966    0.638
    gvslvue           0.920       NA                      0.888    0.444
    gvhlthc           1.058       NA                      1.022    0.695

Covariances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
 .gvslvol ~~                                                            
   .gvslvue           0.113       NA                      0.113    0.054
   .gvhlthc           0.451       NA                      0.451    0.366
 .gvslvue ~~                                                            
   .gvhlthc           0.037       NA                      0.037    0.020

Intercepts:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .gvslvol           7.851       NA                      7.851    5.184
   .gvslvue           6.005       NA                      6.005    3.000
   .gvhlthc           8.057       NA                      8.057    5.481
    welf_supp         0.000                               0.000    0.000

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .gvslvol           1.361       NA                      1.361    0.593
   .gvslvue           3.218       NA                      3.218    0.803
   .gvhlthc           1.116       NA                      1.116    0.516
    welf_supp         0.933       NA                      1.000    1.000


Group 2 [Female]:

Latent Variables:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  welf_supp =~                                                          
    gvslvol           1.000                               0.934    0.644
    gvslvue           0.780       NA                      0.729    0.398
    gvhlthc           0.993       NA                      0.927    0.629

Covariances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
 .gvslvol ~~                                                            
   .gvslvue           0.150       NA                      0.150    0.081
   .gvhlthc           0.405       NA                      0.405    0.319
 .gvslvue ~~                                                            
   .gvhlthc          -0.010       NA                     -0.010   -0.005

Intercepts:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .gvslvol           7.892       NA                      7.892    5.445
   .gvslvue           6.112       NA                      6.112    3.338
   .gvhlthc           8.007       NA                      8.007    5.437
    welf_supp         0.000                               0.000    0.000

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .gvslvol           1.229       NA                      1.229    0.585
   .gvslvue           2.821       NA                      2.821    0.842
   .gvhlthc           1.309       NA                      1.309    0.604
    welf_supp         0.872       NA                      1.000    1.000

Metric invariance model

model_ws_metric <-'
# Factor loadings set equal
welf_supp =~ c(L1,L1)*gvslvol + c(L2,L2)*gvslvue + c(L3,L3)*gvhlthc

# Item intercepts all freely estimated for each group
gvslvol ~ 1 
gvslvue ~ 1 
gvhlthc ~ 1 

# Residual variances all freely estimated for each group
gvslvol ~~ gvslvol 
gvslvue ~~ gvslvue 
gvhlthc ~~ gvhlthc

# Factor mean (intercept) fixed to zero in each group
welf_supp ~ 0

'


fit_metric <- cfa(model_ws_metric, 
                      data = ess_df,
                      group = "gndr")


summary(fit_metric,
        standardized=TRUE, 
        fit.measures = TRUE
)
lavaan 0.6-10 ended normally after 45 iterations

  Estimator                                         ML
  Optimization method                           NLMINB
  Number of model parameters                        18
  Number of equality constraints                     2
                                                      
  Number of observations per group:               Used       Total
    Male                                           861         864
    Female                                         891         896
                                                                  
Model Test User Model:
                                                      
  Test statistic                                 2.555
  Degrees of freedom                                 2
  P-value (Chi-square)                           0.279
  Test statistic for each group:
    Male                                         1.155
    Female                                       1.400

Model Test Baseline Model:

  Test statistic                              1066.962
  Degrees of freedom                                 6
  P-value                                        0.000

User Model versus Baseline Model:

  Comparative Fit Index (CFI)                    0.999
  Tucker-Lewis Index (TLI)                       0.998

Loglikelihood and Information Criteria:

  Loglikelihood user model (H0)              -9426.665
  Loglikelihood unrestricted model (H1)             NA
                                                      
  Akaike (AIC)                               18885.331
  Bayesian (BIC)                             18972.827
  Sample-size adjusted Bayesian (BIC)        18921.997

Root Mean Square Error of Approximation:

  RMSEA                                          0.018
  90 Percent confidence interval - lower         0.000
  90 Percent confidence interval - upper         0.072
  P-value RMSEA <= 0.05                          0.784

Standardized Root Mean Square Residual:

  SRMR                                           0.012

Parameter Estimates:

  Standard errors                             Standard
  Information                                 Expected
  Information saturated (h1) model          Structured


Group 1 [Male]:

Latent Variables:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  welf_supp =~                                                          
    gvslvol   (L1)    1.000                               1.268    0.834
    gvslvue   (L2)    0.595    0.048   12.472    0.000    0.754    0.379
    gvhlthc   (L3)    0.897    0.062   14.381    0.000    1.138    0.776

Intercepts:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .gvslvol           7.851    0.052  151.451    0.000    7.851    5.161
   .gvslvue           6.005    0.068   88.528    0.000    6.005    3.017
   .gvhlthc           8.057    0.050  161.316    0.000    8.057    5.498
    welf_supp         0.000                               0.000    0.000

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .gvslvol           0.706    0.118    5.964    0.000    0.706    0.305
   .gvslvue           3.392    0.170   19.924    0.000    3.392    0.856
   .gvhlthc           0.853    0.100    8.522    0.000    0.853    0.397
    welf_supp         1.608    0.148   10.875    0.000    1.000    1.000


Group 2 [Female]:

Latent Variables:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  welf_supp =~                                                          
    gvslvol   (L1)    1.000                               1.188    0.823
    gvslvue   (L2)    0.595    0.048   12.472    0.000    0.707    0.384
    gvhlthc   (L3)    0.897    0.062   14.381    0.000    1.066    0.721

Intercepts:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .gvslvol           7.892    0.048  163.261    0.000    7.892    5.469
   .gvslvue           6.112    0.062   99.094    0.000    6.112    3.320
   .gvhlthc           8.007    0.050  161.742    0.000    8.007    5.419
    welf_supp         0.000                               0.000    0.000

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .gvslvol           0.670    0.107    6.243    0.000    0.670    0.322
   .gvslvue           2.890    0.144   20.073    0.000    2.890    0.853
   .gvhlthc           1.047    0.097   10.821    0.000    1.047    0.480
    welf_supp         1.412    0.131   10.815    0.000    1.000    1.000

Scalar invariance model

model_ws_scalar <-'
# Factor loadings set equal
welf_supp =~ c(L1,L1)*gvslvol + c(L2,L2)*gvslvue + c(L3,L3)*gvhlthc

# Item intercepts set equal
gvslvol ~ c(I1,I1)*1 
gvslvue ~ c(I2,I2)*1 
gvhlthc ~ c(I3,I3)*1 

# Redidual variances all freely estimated for each group
gvslvol ~~ gvslvol 
gvslvue ~~ gvslvue 
gvhlthc ~~ gvhlthc

# Factor mean (intercept) estimated in G2 and fixed to zero in G1
welf_supp ~ c(0,NA)*0

'


fit_scalar <- cfa(model_ws_scalar, 
                      data = ess_df,
                      group = "gndr")


summary(fit_scalar, 
        standardized=TRUE, 
        fit.measures = TRUE
)
lavaan 0.6-10 ended normally after 47 iterations

  Estimator                                         ML
  Optimization method                           NLMINB
  Number of model parameters                        19
  Number of equality constraints                     5
                                                      
  Number of observations per group:               Used       Total
    Male                                           861         864
    Female                                         891         896
                                                                  
Model Test User Model:
                                                      
  Test statistic                                 6.199
  Degrees of freedom                                 4
  P-value (Chi-square)                           0.185
  Test statistic for each group:
    Male                                         3.053
    Female                                       3.145

Model Test Baseline Model:

  Test statistic                              1066.962
  Degrees of freedom                                 6
  P-value                                        0.000

User Model versus Baseline Model:

  Comparative Fit Index (CFI)                    0.998
  Tucker-Lewis Index (TLI)                       0.997

Loglikelihood and Information Criteria:

  Loglikelihood user model (H0)              -9428.487
  Loglikelihood unrestricted model (H1)             NA
                                                      
  Akaike (AIC)                               18884.975
  Bayesian (BIC)                             18961.534
  Sample-size adjusted Bayesian (BIC)        18917.057

Root Mean Square Error of Approximation:

  RMSEA                                          0.025
  90 Percent confidence interval - lower         0.000
  90 Percent confidence interval - upper         0.061
  P-value RMSEA <= 0.05                          0.850

Standardized Root Mean Square Residual:

  SRMR                                           0.017

Parameter Estimates:

  Standard errors                             Standard
  Information                                 Expected
  Information saturated (h1) model          Structured


Group 1 [Male]:

Latent Variables:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  welf_supp =~                                                          
    gvslvol   (L1)    1.000                               1.270    0.835
    gvslvue   (L2)    0.594    0.048   12.441    0.000    0.754    0.379
    gvhlthc   (L3)    0.894    0.062   14.356    0.000    1.135    0.775

Intercepts:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .gvslvol   (I1)    7.865    0.050  156.652    0.000    7.865    5.171
   .gvslvue   (I2)    6.059    0.050  120.178    0.000    6.059    3.043
   .gvhlthc   (I3)    8.028    0.047  171.303    0.000    8.028    5.478
    welf_supp         0.000                               0.000    0.000

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .gvslvol           0.700    0.119    5.893    0.000    0.700    0.303
   .gvslvue           3.396    0.170   19.924    0.000    3.396    0.856
   .gvhlthc           0.859    0.100    8.594    0.000    0.859    0.400
    welf_supp         1.614    0.148   10.873    0.000    1.000    1.000


Group 2 [Female]:

Latent Variables:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  welf_supp =~                                                          
    gvslvol   (L1)    1.000                               1.190    0.825
    gvslvue   (L2)    0.594    0.048   12.441    0.000    0.707    0.384
    gvhlthc   (L3)    0.894    0.062   14.356    0.000    1.064    0.720

Intercepts:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .gvslvol   (I1)    7.865    0.050  156.652    0.000    7.865    5.450
   .gvslvue   (I2)    6.059    0.050  120.178    0.000    6.059    3.290
   .gvhlthc   (I3)    8.028    0.047  171.303    0.000    8.028    5.432
    welf_supp         0.014    0.066    0.207    0.836    0.012    0.012

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .gvslvol           0.666    0.108    6.173    0.000    0.666    0.320
   .gvslvue           2.893    0.144   20.074    0.000    2.893    0.853
   .gvhlthc           1.053    0.097   10.888    0.000    1.053    0.482
    welf_supp         1.417    0.131   10.812    0.000    1.000    1.000

Scalar invariance model with the addition of gvcldcr

model_ws_gvcldcr <- '
welf_supp =~ gvslvol + gvslvue + gvhlthc + gvcldcr
'

fit_conf_gvcldcr <- cfa(model_ws_gvcldcr, 
                      data = ess_df,
                      group = "gndr"
                )

fit_metric_gvcldcr <- cfa(model_ws_gvcldcr, 
                      data = ess_df,
                      group = "gndr",
                      group.equal = c("loadings")
                )

fit_scalar_gvcldcr <- cfa(model_ws_gvcldcr, 
                      data = ess_df,
                      group = "gndr",
                      group.equal = c("loadings",
                                      "intercepts")
                )


# Let's compare the nested model using the anova function

table_anova <- list(anova(fit_conf_gvcldcr, fit_metric_gvcldcr),
       anova(fit_metric_gvcldcr, fit_scalar_gvcldcr)) %>%  
       reduce(rbind) %>% 
       .[-c(3),]

table_anova
Chi-Squared Difference Test

                   Df   AIC   BIC  Chisq Chisq diff Df diff Pr(>Chisq)    
fit_conf_gvcldcr    4 25344 25475 21.641                                  
fit_metric_gvcldcr  7 25340 25455 23.436      1.795       3  0.6160263    
fit_scalar_gvcldcr 10 25353 25452 42.889     19.453       3  0.0002203 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
lavTestScore(fit_scalar_gvcldcr)
$test

total score test:

   test     X2 df p.value
1 score 21.248  7   0.003

$uni

univariate score tests:

    lhs op   rhs     X2 df p.value
1  .p2. == .p16.  0.064  1   0.801
2  .p3. == .p17.  1.268  1   0.260
3  .p4. == .p18.  0.044  1   0.833
4 .p10. == .p24.  0.108  1   0.743
5 .p11. == .p25.  0.881  1   0.348
6 .p12. == .p26.  5.498  1   0.019
7 .p13. == .p27. 15.885  1   0.000
parTable(fit_scalar_gvcldcr)
   id       lhs op       rhs user block group free ustart exo label plabel start   est    se
1   1 welf_supp =~   gvslvol    1     1     1    0      1   0         .p1. 1.000 1.000 0.000
2   2 welf_supp =~   gvslvue    1     1     1    1     NA   0  .p2.   .p2. 0.646 0.607 0.043
3   3 welf_supp =~   gvhlthc    1     1     1    2     NA   0  .p3.   .p3. 0.831 0.885 0.042
4   4 welf_supp =~   gvcldcr    1     1     1    3     NA   0  .p4.   .p4. 0.624 0.685 0.040
5   5   gvslvol ~~   gvslvol    0     1     1    4     NA   0         .p5. 1.144 0.644 0.083
6   6   gvslvue ~~   gvslvue    0     1     1    5     NA   0         .p6. 2.008 3.404 0.171
7   7   gvhlthc ~~   gvhlthc    0     1     1    6     NA   0         .p7. 1.077 0.914 0.075
8   8   gvcldcr ~~   gvcldcr    0     1     1    7     NA   0         .p8. 1.772 2.823 0.145
9   9 welf_supp ~~ welf_supp    0     1     1    8     NA   0         .p9. 0.050 1.623 0.122
10 10   gvslvol ~1              0     1     1    9     NA   0 .p10.  .p10. 7.855 7.851 0.050
11 11   gvslvue ~1              0     1     1   10     NA   0 .p11.  .p11. 6.006 6.049 0.051
12 12   gvhlthc ~1              0     1     1   11     NA   0 .p12.  .p12. 8.060 8.016 0.047
13 13   gvcldcr ~1              0     1     1   12     NA   0 .p13.  .p13. 7.116 7.286 0.049
14 14 welf_supp ~1              0     1     1    0      0   0        .p14. 0.000 0.000 0.000
15 15 welf_supp =~   gvslvol    1     2     2    0      1   0        .p15. 1.000 1.000 0.000
16 16 welf_supp =~   gvslvue    1     2     2   13     NA   0  .p2.  .p16. 0.600 0.607 0.043
17 17 welf_supp =~   gvhlthc    1     2     2   14     NA   0  .p3.  .p17. 0.933 0.885 0.042
18 18 welf_supp =~   gvcldcr    1     2     2   15     NA   0  .p4.  .p18. 0.752 0.685 0.040
19 19   gvslvol ~~   gvslvol    0     2     2   16     NA   0        .p19. 1.051 0.716 0.078
20 20   gvslvue ~~   gvslvue    0     2     2   17     NA   0        .p20. 1.667 2.831 0.141
21 21   gvhlthc ~~   gvhlthc    0     2     2   18     NA   0        .p21. 1.088 1.039 0.075
22 22   gvcldcr ~~   gvcldcr    0     2     2   19     NA   0        .p22. 1.317 1.985 0.103
23 23 welf_supp ~~ welf_supp    0     2     2   20     NA   0        .p23. 0.050 1.408 0.108
24 24   gvslvol ~1              0     2     2   21     NA   0 .p10.  .p24. 7.891 7.851 0.050
25 25   gvslvue ~1              0     2     2   22     NA   0 .p11.  .p25. 6.110 6.049 0.051
26 26   gvhlthc ~1              0     2     2   23     NA   0 .p12.  .p26. 8.007 8.016 0.047
27 27   gvcldcr ~1              0     2     2   24     NA   0 .p13.  .p27. 7.431 7.286 0.049
28 28 welf_supp ~1              0     2     2   25     NA   0        .p28. 0.000 0.044 0.066
29 29      .p2. ==     .p16.    2     0     0    0     NA   0              0.000 0.000 0.000
30 30      .p3. ==     .p17.    2     0     0    0     NA   0              0.000 0.000 0.000
31 31      .p4. ==     .p18.    2     0     0    0     NA   0              0.000 0.000 0.000
32 32     .p10. ==     .p24.    2     0     0    0     NA   0              0.000 0.000 0.000
33 33     .p11. ==     .p25.    2     0     0    0     NA   0              0.000 0.000 0.000
34 34     .p12. ==     .p26.    2     0     0    0     NA   0              0.000 0.000 0.000
35 35     .p13. ==     .p27.    2     0     0    0     NA   0              0.000 0.000 0.000

5 Ex.2 – Multi-group mediation analysis

  1. Fit a model where egalitarianism (gincdif, dfincac, smdfslv) mediates the relationship between age (agea), education (eduyrs), income (hinctnta) and welfare support (gvslvol, gvslvue, gvhlthc) in a multigroup model where all paths coefficients are free to vary across group
    • Y is the dependent variable (Welfare support)
    • X is a vector of predictors (age, education, income)
    • M is a mediator (Egalitarianism)
    • G is a grouping variable (Gender)
  2. Assess if the model fits the data well
  3. Use lavaan syntax to calculate indirect and direct effects for each predictor in each group.
  4. Interpret the difference in the path coefficients between male and female
  5. Assess if the path from Education to Egalitarianism (Path A) can be set equal across the two groups
  6. Assess if the Indirect effect of Education on Welfare Support (a*b) can be set equal across the two groups (OPTIONAL)
  7. Think of a method to assess if path coefficients are statistically different using the := operator (OPTIONAL)

All free

model_mediation_mg <- '
## Welfare Support Factor ##
welf_supp =~ gvslvol + gvslvue + gvhlthc

## Egalitarianism ##
egual =~  gincdif + dfincac + smdfslv

## Direct effect ##
welf_supp ~ c("c_inc_1", "c_inc_2")*hinctnta
welf_supp ~ c("c_age_1", "c_age_2")*agea
welf_supp ~ c("c_edu_1", "c_edu_2")*eduyrs

## Mediator ##
# Path A 
egual ~ c("a_inc_1", "a_inc_2")*hinctnta
egual ~ c("a_age_1", "a_age_2")*agea
egual ~ c("a_edu_1", "a_edu_2")*eduyrs
# Path B
welf_supp ~ c("b1", "b2")*egual

## Indirect effect (a*b) ##
# G1 
ab_inc_g1 := a_inc_1*b1
ab_age_g1 := a_age_1*b1
ab_edu_g1 := a_edu_1*b1
# G2 
ab_inc_g2 := a_inc_2*b2
ab_age_g2 := a_age_2*b2
ab_edu_g2 := a_edu_2*b2

## Total effect c + (a*b) ##
# G1 
total_inc_g1 := c_inc_1 + (a_inc_1*b1)
total_age_g1 := c_age_1 + (a_age_1*b1)
total_edu_g1 := c_edu_1 + (a_edu_1*b1)
# G1 
total_inc_g2 := c_inc_2 + (a_inc_2*b2)
total_age_g2 := c_age_2 + (a_age_2*b2)
total_edu_g2 := c_edu_2 + (a_edu_2*b2)
'

fit_mediation_mg <- cfa(model_mediation_mg,       # model formula
                     data = ess_df,               # data frame
                     group = "gndr",              # grouping variable (G)
                     group.equal = c("loadings")  # equal loadings 

  )

summary(fit_mediation_mg, 
        standardized=TRUE, 
        fit.measures = TRUE
)
lavaan 0.6-10 ended normally after 99 iterations

  Estimator                                         ML
  Optimization method                           NLMINB
  Number of model parameters                        50
  Number of equality constraints                     4
                                                      
  Number of observations per group:               Used       Total
    Male                                           779         864
    Female                                         772         896
                                                                  
Model Test User Model:
                                                      
  Test statistic                               138.860
  Degrees of freedom                                44
  P-value (Chi-square)                           0.000
  Test statistic for each group:
    Male                                        89.341
    Female                                      49.519

Model Test Baseline Model:

  Test statistic                              1674.649
  Degrees of freedom                                66
  P-value                                        0.000

User Model versus Baseline Model:

  Comparative Fit Index (CFI)                    0.941
  Tucker-Lewis Index (TLI)                       0.912

Loglikelihood and Information Criteria:

  Loglikelihood user model (H0)             -14754.970
  Loglikelihood unrestricted model (H1)             NA
                                                      
  Akaike (AIC)                               29601.940
  Bayesian (BIC)                             29847.887
  Sample-size adjusted Bayesian (BIC)        29701.755

Root Mean Square Error of Approximation:

  RMSEA                                          0.053
  90 Percent confidence interval - lower         0.043
  90 Percent confidence interval - upper         0.063
  P-value RMSEA <= 0.05                          0.310

Standardized Root Mean Square Residual:

  SRMR                                           0.036

Parameter Estimates:

  Standard errors                             Standard
  Information                                 Expected
  Information saturated (h1) model          Structured


Group 1 [Male]:

Latent Variables:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  welf_supp =~                                                          
    gvslvol           1.000                               1.363    0.889
    gvslvue (.p2.)    0.557    0.047   11.781    0.000    0.759    0.375
    gvhlthc (.p3.)    0.796    0.052   15.291    0.000    1.085    0.740
  egual =~                                                              
    gincdif           1.000                               0.709    0.654
    dfincac (.p5.)   -0.585    0.058  -10.007    0.000   -0.415   -0.395
    smdfslv (.p6.)    0.868    0.079   11.049    0.000    0.616    0.613

Regressions:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  welf_supp ~                                                           
    hnctnt (c_n_1)    0.021    0.025    0.857    0.392    0.015    0.036
    agea   (c_g_1)    0.011    0.003    3.527    0.000    0.008    0.140
    eduyrs (c_d_1)    0.010    0.016    0.655    0.513    0.007    0.028
  egual ~                                                               
    hnctnt (a_n_1)    0.036    0.015    2.417    0.016    0.050    0.117
    agea   (a_g_1)   -0.005    0.002   -2.606    0.009   -0.007   -0.119
    eduyrs (a_d_1)    0.038    0.009    4.087    0.000    0.053    0.199
  welf_supp ~                                                           
    egual     (b1)   -0.466    0.106   -4.380    0.000   -0.242   -0.242

Intercepts:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .gvslvol           7.336    0.289   25.420    0.000    7.336    4.788
   .gvslvue           5.667    0.175   32.382    0.000    5.667    2.803
   .gvhlthc           7.626    0.233   32.792    0.000    7.626    5.199
   .gincdif           1.703    0.176    9.660    0.000    1.703    1.570
   .dfincac           2.854    0.109   26.119    0.000    2.854    2.717
   .smdfslv           2.046    0.154   13.280    0.000    2.046    2.035
   .welf_supp         0.000                               0.000    0.000
   .egual             0.000                               0.000    0.000

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .gvslvol           0.490    0.123    3.989    0.000    0.490    0.209
   .gvslvue           3.511    0.184   19.065    0.000    3.511    0.859
   .gvhlthc           0.974    0.091   10.672    0.000    0.974    0.453
   .gincdif           0.673    0.060   11.142    0.000    0.673    0.572
   .dfincac           0.931    0.052   17.881    0.000    0.931    0.844
   .smdfslv           0.632    0.050   12.709    0.000    0.632    0.625
   .welf_supp         1.703    0.156   10.947    0.000    0.917    0.917
   .egual             0.456    0.060    7.650    0.000    0.905    0.905


Group 2 [Female]:

Latent Variables:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  welf_supp =~                                                          
    gvslvol           1.000                               1.234    0.880
    gvslvue (.p2.)    0.557    0.047   11.781    0.000    0.687    0.374
    gvhlthc (.p3.)    0.796    0.052   15.291    0.000    0.982    0.682
  egual =~                                                              
    gincdif           1.000                               0.679    0.657
    dfincac (.p5.)   -0.585    0.058  -10.007    0.000   -0.397   -0.375
    smdfslv (.p6.)    0.868    0.079   11.049    0.000    0.589    0.626

Regressions:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  welf_supp ~                                                           
    hnctnt (c_n_2)   -0.003    0.023   -0.143    0.886   -0.003   -0.006
    agea   (c_g_2)    0.008    0.003    2.725    0.006    0.006    0.114
    eduyrs (c_d_2)    0.035    0.015    2.263    0.024    0.028    0.101
  egual ~                                                               
    hnctnt (a_n_2)    0.038    0.015    2.591    0.010    0.056    0.134
    agea   (a_g_2)   -0.002    0.002   -0.995    0.320   -0.003   -0.048
    eduyrs (a_d_2)    0.012    0.010    1.178    0.239    0.017    0.061
  welf_supp ~                                                           
    egual     (b2)   -0.473    0.098   -4.820    0.000   -0.260   -0.260

Intercepts:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .gvslvol           7.302    0.285   25.654    0.000    7.302    5.207
   .gvslvue           5.776    0.171   33.718    0.000    5.776    3.143
   .gvhlthc           7.522    0.230   32.661    0.000    7.522    5.224
   .gincdif           1.837    0.182   10.098    0.000    1.837    1.778
   .dfincac           2.935    0.112   26.286    0.000    2.935    2.774
   .smdfslv           2.119    0.158   13.379    0.000    2.119    2.253
   .welf_supp         0.000                               0.000    0.000
   .egual             0.000                               0.000    0.000

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .gvslvol           0.445    0.107    4.178    0.000    0.445    0.226
   .gvslvue           2.906    0.154   18.878    0.000    2.906    0.860
   .gvhlthc           1.108    0.087   12.675    0.000    1.108    0.534
   .gincdif           0.607    0.056   10.794    0.000    0.607    0.569
   .dfincac           0.962    0.053   18.036    0.000    0.962    0.859
   .smdfslv           0.538    0.045   11.966    0.000    0.538    0.608
   .welf_supp         1.394    0.132   10.594    0.000    0.916    0.916
   .egual             0.444    0.057    7.790    0.000    0.963    0.963

Defined Parameters:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
    ab_inc_g1        -0.017    0.008   -2.137    0.033   -0.012   -0.028
    ab_age_g1         0.002    0.001    2.263    0.024    0.002    0.029
    ab_edu_g1        -0.018    0.006   -3.046    0.002   -0.013   -0.048
    ab_inc_g2        -0.018    0.008   -2.308    0.021   -0.015   -0.035
    ab_age_g2         0.001    0.001    0.976    0.329    0.001    0.013
    ab_edu_g2        -0.006    0.005   -1.148    0.251   -0.004   -0.016
    total_inc_g1      0.004    0.024    0.180    0.857    0.003    0.007
    total_age_g1      0.013    0.003    4.282    0.000    0.010    0.169
    total_edu_g1     -0.007    0.015   -0.491    0.623   -0.005   -0.020
    total_inc_g2     -0.021    0.023   -0.927    0.354   -0.017   -0.041
    total_age_g2      0.008    0.003    3.003    0.003    0.007    0.127
    total_edu_g2      0.029    0.016    1.894    0.058    0.024    0.085

Path A education to Egalitarianism set equal across the two groups

model_mediation_mg_path_a <- '
## Welfare Support Factor ##
welf_supp =~ gvslvol + gvslvue + gvhlthc

## Egalitarianism ##
egual =~  gincdif + dfincac + smdfslv

## Direct effect ##
welf_supp ~ c("c_inc_1", "c_inc_2")*hinctnta
welf_supp ~ c("c_age_1", "c_age_2")*agea
welf_supp ~ c("c_edu_1", "c_edu_2")*eduyrs

## Mediator ##
# Path A 
egual ~ c("a_inc_1", "a_inc_2")*hinctnta
egual ~ c("a_age_1", "a_age_2")*agea
egual ~ c("a_edu", "a_edu")*eduyrs
# Path B
welf_supp ~ c("b1", "b2")*egual

## Indirect effect (a*b) ##
# G1 
ab_inc_g1 := a_inc_1*b1
ab_age_g1 := a_age_1*b1
ab_edu_g1 := a_edu*b1
# G2 
ab_inc_g2 := a_inc_2*b2
ab_age_g2 := a_age_2*b2
ab_edu_g2 := a_edu*b2

## Total effect c + (a*b) ##
# G1 
total_inc_g1 := c_inc_1 + (a_inc_1*b1)
total_age_g1 := c_age_1 + (a_age_1*b1)
total_edu_g1 := c_edu_1 + (a_edu*b1)
# G1 
total_inc_g2 := c_inc_2 + (a_inc_2*b2)
total_age_g2 := c_age_2 + (a_age_2*b2)
total_edu_g2 := c_edu_2 + (a_edu*b2)
'

fit_mediation_mg_path_a <- cfa(model_mediation_mg_path_a, # model formula
                     data = ess_df,                       # data frame
                     group = "gndr",                      # grouping variable (G)
                     group.equal = c("loadings")          # equal loadings 

  )

anova(fit_mediation_mg,
        standardized=TRUE, 
        fit.measures = TRUE
)
Chi-Squared Test Statistic (unscaled)

          Df   AIC   BIC  Chisq Chisq diff Df diff        Pr(>Chisq)    
Saturated  0               0.00                                         
Model     44 29602 29848 138.86     138.86      44 0.000000000009203 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Path B Egalitarianism to Welfare Support set equal across the two groups

model_mediation_mg_path_ab <- '
## Welfare Support Factor ##
welf_supp =~ gvslvol + gvslvue + gvhlthc

## Egalitarianism ##
egual =~  gincdif + dfincac + smdfslv

## Direct effect ##
welf_supp ~ c("c_inc_1", "c_inc_2")*hinctnta
welf_supp ~ c("c_age_1", "c_age_2")*agea
welf_supp ~ c("c_edu_1", "c_edu_2")*eduyrs

## Mediator ##
# Path A 
egual ~ c("a_inc_1", "a_inc_2")*hinctnta
egual ~ c("a_age_1", "a_age_2")*agea
egual ~ c("a_edu", "a_edu")*eduyrs
# Path B
welf_supp ~ c("b", "b")*egual

## Indirect effect (a*b) ##
# G1 
ab_inc_g1 := a_inc_1*b
ab_age_g1 := a_age_1*b
ab_edu_g1 := a_edu*b
# G2 
ab_inc_g2 := a_inc_2*b
ab_age_g2 := a_age_2*b
ab_edu_g2 := a_edu*b

## Total effect c + (a*b) ##
# G1 
total_inc_g1 := c_inc_1 + (a_inc_1*b)
total_age_g1 := c_age_1 + (a_age_1*b)
total_edu_g1 := c_edu_1 + (a_edu*b)
# G1 
total_inc_g2 := c_inc_2 + (a_inc_2*b)
total_age_g2 := c_age_2 + (a_age_2*b)
total_edu_g2 := c_edu_2 + (a_edu*b)
'

fit_mediation_mg_path_ab <- cfa(model_mediation_mg_path_ab, # model formula
                     data = ess_df,                         # data frame
                     group = "gndr",                        # grouping variable (G)
                     group.equal = c("loadings")            # equal loadings 

  )

anova(fit_mediation_mg_path_a,fit_mediation_mg_path_ab)
Chi-Squared Difference Test

                         Df   AIC   BIC  Chisq Chisq diff Df diff Pr(>Chisq)
fit_mediation_mg_path_a  45 29604 29844 142.63                              
fit_mediation_mg_path_ab 46 29602 29837 142.63  0.0011676       1     0.9727

Using the := for simple slope difference

model_mediation_mg_diff <- '
## Welfare Support Factor ##
welf_supp =~ gvslvol + gvslvue + gvhlthc

## Egalitarianism ##
egual =~  gincdif + dfincac + smdfslv

## Direct effect ##
welf_supp ~ c("c_inc_1", "c_inc_2")*hinctnta
welf_supp ~ c("c_age_1", "c_age_2")*agea
welf_supp ~ c("c_edu_1", "c_edu_2")*eduyrs

## Mediator ##
# Path A 
egual ~ c("a_inc_1", "a_inc_2")*hinctnta
egual ~ c("a_age_1", "a_age_2")*agea
egual ~ c("a_edu_1", "a_edu_2")*eduyrs
# Path B
welf_supp ~ c("b1", "b2")*egual

## Indirect effect (a*b) ##
# G1 
ab_inc_g1 := a_inc_1*b1
ab_age_g1 := a_age_1*b1
ab_edu_g1 := a_edu_1*b1
# G2 
ab_inc_g2 := a_inc_2*b2
ab_age_g2 := a_age_2*b2
ab_edu_g2 := a_edu_2*b2

## Total effect c + (a*b) ##
# G1 
total_inc_g1 := c_inc_1 + (a_inc_1*b1)
total_age_g1 := c_age_1 + (a_age_1*b1)
total_edu_g1 := c_edu_1 + (a_edu_1*b1)
# G1 
total_inc_g2 := c_inc_2 + (a_inc_2*b2)
total_age_g2 := c_age_2 + (a_age_2*b2)
total_edu_g2 := c_edu_2 + (a_edu_2*b2)
## Slope Differences ##
tot_edu_diff := total_edu_g1 - total_edu_g2

'

fit_mediation_mg_diff <- cfa(model_mediation_mg_diff, # model formula
                     data = ess_df,              # data frame
                     group = "gndr",             # grouping variable (G)
                     group.equal = c("loadings") # equal loadings 

  )

summary(fit_mediation_mg_diff,
        standardized=TRUE, 
        fit.measures = TRUE
)
lavaan 0.6-10 ended normally after 99 iterations

  Estimator                                         ML
  Optimization method                           NLMINB
  Number of model parameters                        50
  Number of equality constraints                     4
                                                      
  Number of observations per group:               Used       Total
    Male                                           779         864
    Female                                         772         896
                                                                  
Model Test User Model:
                                                      
  Test statistic                               138.860
  Degrees of freedom                                44
  P-value (Chi-square)                           0.000
  Test statistic for each group:
    Male                                        89.341
    Female                                      49.519

Model Test Baseline Model:

  Test statistic                              1674.649
  Degrees of freedom                                66
  P-value                                        0.000

User Model versus Baseline Model:

  Comparative Fit Index (CFI)                    0.941
  Tucker-Lewis Index (TLI)                       0.912

Loglikelihood and Information Criteria:

  Loglikelihood user model (H0)             -14754.970
  Loglikelihood unrestricted model (H1)             NA
                                                      
  Akaike (AIC)                               29601.940
  Bayesian (BIC)                             29847.887
  Sample-size adjusted Bayesian (BIC)        29701.755

Root Mean Square Error of Approximation:

  RMSEA                                          0.053
  90 Percent confidence interval - lower         0.043
  90 Percent confidence interval - upper         0.063
  P-value RMSEA <= 0.05                          0.310

Standardized Root Mean Square Residual:

  SRMR                                           0.036

Parameter Estimates:

  Standard errors                             Standard
  Information                                 Expected
  Information saturated (h1) model          Structured


Group 1 [Male]:

Latent Variables:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  welf_supp =~                                                          
    gvslvol           1.000                               1.363    0.889
    gvslvue (.p2.)    0.557    0.047   11.781    0.000    0.759    0.375
    gvhlthc (.p3.)    0.796    0.052   15.291    0.000    1.085    0.740
  egual =~                                                              
    gincdif           1.000                               0.709    0.654
    dfincac (.p5.)   -0.585    0.058  -10.007    0.000   -0.415   -0.395
    smdfslv (.p6.)    0.868    0.079   11.049    0.000    0.616    0.613

Regressions:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  welf_supp ~                                                           
    hnctnt (c_n_1)    0.021    0.025    0.857    0.392    0.015    0.036
    agea   (c_g_1)    0.011    0.003    3.527    0.000    0.008    0.140
    eduyrs (c_d_1)    0.010    0.016    0.655    0.513    0.007    0.028
  egual ~                                                               
    hnctnt (a_n_1)    0.036    0.015    2.417    0.016    0.050    0.117
    agea   (a_g_1)   -0.005    0.002   -2.606    0.009   -0.007   -0.119
    eduyrs (a_d_1)    0.038    0.009    4.087    0.000    0.053    0.199
  welf_supp ~                                                           
    egual     (b1)   -0.466    0.106   -4.380    0.000   -0.242   -0.242

Intercepts:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .gvslvol           7.336    0.289   25.420    0.000    7.336    4.788
   .gvslvue           5.667    0.175   32.382    0.000    5.667    2.803
   .gvhlthc           7.626    0.233   32.792    0.000    7.626    5.199
   .gincdif           1.703    0.176    9.660    0.000    1.703    1.570
   .dfincac           2.854    0.109   26.119    0.000    2.854    2.717
   .smdfslv           2.046    0.154   13.280    0.000    2.046    2.035
   .welf_supp         0.000                               0.000    0.000
   .egual             0.000                               0.000    0.000

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .gvslvol           0.490    0.123    3.989    0.000    0.490    0.209
   .gvslvue           3.511    0.184   19.065    0.000    3.511    0.859
   .gvhlthc           0.974    0.091   10.672    0.000    0.974    0.453
   .gincdif           0.673    0.060   11.142    0.000    0.673    0.572
   .dfincac           0.931    0.052   17.881    0.000    0.931    0.844
   .smdfslv           0.632    0.050   12.709    0.000    0.632    0.625
   .welf_supp         1.703    0.156   10.947    0.000    0.917    0.917
   .egual             0.456    0.060    7.650    0.000    0.905    0.905


Group 2 [Female]:

Latent Variables:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  welf_supp =~                                                          
    gvslvol           1.000                               1.234    0.880
    gvslvue (.p2.)    0.557    0.047   11.781    0.000    0.687    0.374
    gvhlthc (.p3.)    0.796    0.052   15.291    0.000    0.982    0.682
  egual =~                                                              
    gincdif           1.000                               0.679    0.657
    dfincac (.p5.)   -0.585    0.058  -10.007    0.000   -0.397   -0.375
    smdfslv (.p6.)    0.868    0.079   11.049    0.000    0.589    0.626

Regressions:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  welf_supp ~                                                           
    hnctnt (c_n_2)   -0.003    0.023   -0.143    0.886   -0.003   -0.006
    agea   (c_g_2)    0.008    0.003    2.725    0.006    0.006    0.114
    eduyrs (c_d_2)    0.035    0.015    2.263    0.024    0.028    0.101
  egual ~                                                               
    hnctnt (a_n_2)    0.038    0.015    2.591    0.010    0.056    0.134
    agea   (a_g_2)   -0.002    0.002   -0.995    0.320   -0.003   -0.048
    eduyrs (a_d_2)    0.012    0.010    1.178    0.239    0.017    0.061
  welf_supp ~                                                           
    egual     (b2)   -0.473    0.098   -4.820    0.000   -0.260   -0.260

Intercepts:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .gvslvol           7.302    0.285   25.654    0.000    7.302    5.207
   .gvslvue           5.776    0.171   33.718    0.000    5.776    3.143
   .gvhlthc           7.522    0.230   32.661    0.000    7.522    5.224
   .gincdif           1.837    0.182   10.098    0.000    1.837    1.778
   .dfincac           2.935    0.112   26.286    0.000    2.935    2.774
   .smdfslv           2.119    0.158   13.379    0.000    2.119    2.253
   .welf_supp         0.000                               0.000    0.000
   .egual             0.000                               0.000    0.000

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .gvslvol           0.445    0.107    4.178    0.000    0.445    0.226
   .gvslvue           2.906    0.154   18.878    0.000    2.906    0.860
   .gvhlthc           1.108    0.087   12.675    0.000    1.108    0.534
   .gincdif           0.607    0.056   10.794    0.000    0.607    0.569
   .dfincac           0.962    0.053   18.036    0.000    0.962    0.859
   .smdfslv           0.538    0.045   11.966    0.000    0.538    0.608
   .welf_supp         1.394    0.132   10.594    0.000    0.916    0.916
   .egual             0.444    0.057    7.790    0.000    0.963    0.963

Defined Parameters:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
    ab_inc_g1        -0.017    0.008   -2.137    0.033   -0.012   -0.028
    ab_age_g1         0.002    0.001    2.263    0.024    0.002    0.029
    ab_edu_g1        -0.018    0.006   -3.046    0.002   -0.013   -0.048
    ab_inc_g2        -0.018    0.008   -2.308    0.021   -0.015   -0.035
    ab_age_g2         0.001    0.001    0.976    0.329    0.001    0.013
    ab_edu_g2        -0.006    0.005   -1.148    0.251   -0.004   -0.016
    total_inc_g1      0.004    0.024    0.180    0.857    0.003    0.007
    total_age_g1      0.013    0.003    4.282    0.000    0.010    0.169
    total_edu_g1     -0.007    0.015   -0.491    0.623   -0.005   -0.020
    total_inc_g2     -0.021    0.023   -0.927    0.354   -0.017   -0.041
    total_age_g2      0.008    0.003    3.003    0.003    0.007    0.127
    total_edu_g2      0.029    0.016    1.894    0.058    0.024    0.085
    tot_edu_diff     -0.037    0.022   -1.700    0.089   -0.029   -0.105

6 !!Support Ukraine!!