Structural Equation Models (CFA)

Tutorial

Author

Orlando Sabogal-Cardona

Published

May 30, 2024

Libraries

library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr     1.1.3     ✔ readr     2.1.4
✔ forcats   1.0.0     ✔ stringr   1.5.1
✔ ggplot2   3.4.4     ✔ tibble    3.2.1
✔ lubridate 1.9.3     ✔ tidyr     1.3.0
✔ purrr     1.0.2     
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(magrittr)

Attaching package: 'magrittr'

The following object is masked from 'package:purrr':

    set_names

The following object is masked from 'package:tidyr':

    extract
library(lavaan) # install.packages("lavaan")
This is lavaan 0.6-17
lavaan is FREE software! Please report any bugs.

Linear model

head(mtcars)
                   mpg cyl disp  hp drat    wt  qsec vs am gear carb
Mazda RX4         21.0   6  160 110 3.90 2.620 16.46  0  1    4    4
Mazda RX4 Wag     21.0   6  160 110 3.90 2.875 17.02  0  1    4    4
Datsun 710        22.8   4  108  93 3.85 2.320 18.61  1  1    4    1
Hornet 4 Drive    21.4   6  258 110 3.08 3.215 19.44  1  0    3    1
Hornet Sportabout 18.7   8  360 175 3.15 3.440 17.02  0  0    3    2
Valiant           18.1   6  225 105 2.76 3.460 20.22  1  0    3    1
Specification <- 'mpg ~ disp + hp + drat'
lm(Specification, data = mtcars) %>% 
  summary()

Call:
lm(formula = Specification, data = mtcars)

Residuals:
    Min      1Q  Median      3Q     Max 
-5.1225 -1.8454 -0.4456  1.1342  6.4958 

Coefficients:
             Estimate Std. Error t value Pr(>|t|)   
(Intercept) 19.344293   6.370882   3.036  0.00513 **
disp        -0.019232   0.009371  -2.052  0.04960 * 
hp          -0.031229   0.013345  -2.340  0.02663 * 
drat         2.714975   1.487366   1.825  0.07863 . 
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 3.008 on 28 degrees of freedom
Multiple R-squared:  0.775, Adjusted R-squared:  0.7509 
F-statistic: 32.15 on 3 and 28 DF,  p-value: 3.28e-09
Model <- sem(model = Specification, data = mtcars)
summary(Model, standardized  = TRUE)
lavaan 0.6.17 ended normally after 1 iteration

  Estimator                                         ML
  Optimization method                           NLMINB
  Number of model parameters                         4

  Number of observations                            32

Model Test User Model:
                                                      
  Test statistic                                 0.000
  Degrees of freedom                                 0

Parameter Estimates:

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

Regressions:
                   Estimate   Std.Err  z-value  P(>|z|)   Std.lv   Std.all
  mpg ~                                                                   
    disp              -0.019    0.009   -2.194    0.028    -0.019   -0.395
    hp                -0.031    0.012   -2.502    0.012    -0.031   -0.355
    drat               2.715    1.391    1.951    0.051     2.715    0.241

Variances:
                   Estimate   Std.Err  z-value  P(>|z|)   Std.lv   Std.all
   .mpg                7.917    1.979    4.000    0.000     7.917    0.225

Path Analysis

First example

Specification <- '
    mpg ~ disp + hp + drat
    hp ~ qsec + vs + am
'
Model <- sem(model = Specification, data = mtcars)
summary(Model, standardized = TRUE, rsquare = TRUE,  fit.measures = TRUE)
lavaan 0.6.17 ended normally after 1 iteration

  Estimator                                         ML
  Optimization method                           NLMINB
  Number of model parameters                         8

  Number of observations                            32

Model Test User Model:
                                                      
  Test statistic                                19.816
  Degrees of freedom                                 5
  P-value (Chi-square)                           0.001

Model Test Baseline Model:

  Test statistic                               104.355
  Degrees of freedom                                11
  P-value                                        0.000

User Model versus Baseline Model:

  Comparative Fit Index (CFI)                    0.841
  Tucker-Lewis Index (TLI)                       0.651

Loglikelihood and Information Criteria:

  Loglikelihood user model (H0)               -240.294
  Loglikelihood unrestricted model (H1)       -230.386
                                                      
  Akaike (AIC)                                 496.588
  Bayesian (BIC)                               508.314
  Sample-size adjusted Bayesian (SABIC)        483.374

Root Mean Square Error of Approximation:

  RMSEA                                          0.304
  90 Percent confidence interval - lower         0.172
  90 Percent confidence interval - upper         0.450
  P-value H_0: RMSEA <= 0.050                    0.002
  P-value H_0: RMSEA >= 0.080                    0.995

Standardized Root Mean Square Residual:

  SRMR                                           0.045

Parameter Estimates:

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

Regressions:
                   Estimate   Std.Err  z-value  P(>|z|)   Std.lv   Std.all
  mpg ~                                                                   
    disp              -0.019    0.007   -2.812    0.005    -0.019   -0.407
    hp                -0.031    0.009   -3.295    0.001    -0.031   -0.366
    drat               2.715    1.348    2.015    0.044     2.715    0.248
  hp ~                                                                    
    qsec             -26.030    6.791   -3.833    0.000   -26.030   -0.678
    vs               -21.111   23.771   -0.888    0.374   -21.111   -0.155
    am               -51.254   16.470   -3.112    0.002   -51.254   -0.373

Variances:
                   Estimate   Std.Err  z-value  P(>|z|)   Std.lv   Std.all
   .mpg                7.917    1.979    4.000    0.000     7.917    0.238
   .hp              1441.729  360.432    4.000    0.000  1441.729    0.317

R-Square:
                   Estimate 
    mpg                0.762
    hp                 0.683
GoF = c("srmr", "rmsea", "tli", "cfi") 
fitmeasures(Model, fit.measures = GoF) 
 srmr rmsea   tli   cfi 
0.045 0.304 0.651 0.841 

Second example

Specification <- '
    mpg ~ disp + hp + drat
    hp ~ qsec + vs + am
    drat ~ vs + am
    
    drat ~~ disp
'
Model <- sem(model = Specification, data = mtcars)
Warning in lav_data_full(data = data, group = group, cluster = cluster, :
lavaan WARNING: some observed variances are (at least) a factor 1000 times
larger than others; use varTable(fit) to investigate
Warning in lav_partable_vnames(FLAT, "ov.x", warn = TRUE): lavaan WARNING:
    model syntax contains variance/covariance/intercept formulas
    involving (an) exogenous variable(s): [disp]; These variables will
    now be treated as random introducing additional free parameters.
    If you wish to treat those variables as fixed, remove these
    formulas from the model syntax. Otherwise, consider adding the
    fixed.x = FALSE option.
summary(Model, standardized = TRUE, rsquare = TRUE,  fit.measures = TRUE)
lavaan 0.6.17 ended normally after 38 iterations

  Estimator                                         ML
  Optimization method                           NLMINB
  Number of model parameters                        13

  Number of observations                            32

Model Test User Model:
                                                      
  Test statistic                                64.744
  Degrees of freedom                                 9
  P-value (Chi-square)                           0.000

Model Test Baseline Model:

  Test statistic                               182.178
  Degrees of freedom                                18
  P-value                                        0.000

User Model versus Baseline Model:

  Comparative Fit Index (CFI)                    0.660
  Tucker-Lewis Index (TLI)                       0.321

Loglikelihood and Information Criteria:

  Loglikelihood user model (H0)               -447.841
  Loglikelihood unrestricted model (H1)       -415.469
                                                      
  Akaike (AIC)                                 921.682
  Bayesian (BIC)                               940.737
  Sample-size adjusted Bayesian (SABIC)        900.210

Root Mean Square Error of Approximation:

  RMSEA                                          0.440
  90 Percent confidence interval - lower         0.343
  90 Percent confidence interval - upper         0.544
  P-value H_0: RMSEA <= 0.050                    0.000
  P-value H_0: RMSEA >= 0.080                    1.000

Standardized Root Mean Square Residual:

  SRMR                                           0.318

Parameter Estimates:

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

Regressions:
                   Estimate   Std.Err  z-value  P(>|z|)   Std.lv   Std.all
  mpg ~                                                                   
    disp              -0.019    0.004   -4.341    0.000    -0.019   -0.491
    hp                -0.031    0.008   -4.088    0.000    -0.031   -0.441
    drat               2.715    1.223    2.220    0.026     2.715    0.259
  hp ~                                                                    
    qsec             -26.030    6.791   -3.833    0.000   -26.030   -0.678
    vs               -21.111   23.771   -0.888    0.374   -21.111   -0.155
    am               -51.254   16.470   -3.112    0.002   -51.254   -0.373
  drat ~                                                                  
    vs                 0.131    0.114    1.149    0.251     0.131    0.142
    am                 0.533    0.115    4.641    0.000     0.533    0.575

Covariances:
                   Estimate   Std.Err  z-value  P(>|z|)   Std.lv   Std.all
 .drat ~~                                                                 
    disp             -21.079    8.593   -2.453    0.014   -21.079   -0.481

Variances:
                   Estimate   Std.Err  z-value  P(>|z|)   Std.lv   Std.all
   .mpg                7.917    1.979    4.000    0.000     7.917    0.346
   .hp              1441.729  360.432    4.000    0.000  1441.729    0.317
   .drat               0.129    0.032    4.000    0.000     0.129    0.621
    disp           14880.776 3720.194    4.000    0.000 14880.776    1.000

R-Square:
                   Estimate 
    mpg                0.654
    hp                 0.683
    drat               0.379

SEM

PoliticalDemocracy dataset https://lavaan.ugent.be/tutorial/sem.html

PoliticalDemocracy
      y1       y2        y3        y4        y5       y6       y7        y8
1   2.50 0.000000  3.333333  0.000000  1.250000 0.000000 3.726360  3.333333
2   1.25 0.000000  3.333333  0.000000  6.250000 1.100000 6.666666  0.736999
3   7.50 8.800000  9.999998  9.199991  8.750000 8.094061 9.999998  8.211809
4   8.90 8.800000  9.999998  9.199991  8.907948 8.127979 9.999998  4.615086
5  10.00 3.333333  9.999998  6.666666  7.500000 3.333333 9.999998  6.666666
6   7.50 3.333333  6.666666  6.666666  6.250000 1.100000 6.666666  0.368500
7   7.50 3.333333  6.666666  6.666666  5.000000 2.233333 8.271257  1.485166
8   7.50 2.233333  9.999998  1.496333  6.250000 3.333333 9.999998  6.666666
9   2.50 3.333333  3.333333  3.333333  6.250000 3.333333 3.333333  3.333333
10 10.00 6.666666  9.999998  8.899991  8.750000 6.666666 9.999998 10.000000
11  7.50 3.333333  9.999998  6.666666  8.750000 3.333333 9.999998  6.666666
12  7.50 3.333333  6.666666  6.666666  8.750000 3.333333 6.666666  6.666666
13  7.50 3.333333  9.999998  6.666666  7.500000 3.333333 6.666666 10.000000
14  7.50 7.766664  9.999998  6.666666  7.500000 0.000000 9.999998  0.000000
15  7.50 9.999998  3.333333 10.000000  7.500000 6.666666 9.999998 10.000000
16  7.50 9.999998  9.999998  7.766666  7.500000 1.100000 6.666666  6.666666
17  2.50 3.333333  6.666666  6.666666  5.000000 1.100000 6.666666  0.368500
18  1.25 0.000000  3.333333  3.333333  1.250000 3.333333 3.333333  3.333333
19 10.00 9.999998  9.999998 10.000000  8.750000 9.999998 9.999998 10.000000
20  7.50 3.333299  3.333333  6.666666  7.500000 2.233299 6.666666  2.948164
21 10.00 9.999998  9.999998 10.000000 10.000000 9.999998 9.999998 10.000000
22  1.25 0.000000  0.000000  0.000000  2.500000 0.000000 0.000000  0.000000
23  2.50 0.000000  3.333333  3.333333  2.500000 0.000000 3.333333  3.333333
24  7.50 6.666666  9.999998 10.000000  7.500000 6.666666 9.999998  7.766666
25  8.50 9.999998  6.666666  6.666666  8.750000 9.999998 7.351018  6.666666
26  6.10 0.000000  5.400000  3.333333  0.000000 0.000000 4.696028  3.333333
27  3.30 0.000000  6.666666  3.333333  6.250000 0.000000 6.666666  3.333333
28  2.90 3.333333  6.666666  3.333333  2.385559 0.000000 3.177568  1.116666
29  9.20 0.000000  9.900000  3.333333  7.609660 0.000000 8.118828  3.333333
30  6.90 0.000000  6.666666  3.333333  4.226033 0.000000 0.000000  0.000000
31  2.90 0.000000  3.333333  3.333333  5.000000 0.000000 3.333333  3.333333
32  2.00 0.000000  0.000000  0.000000  0.000000 0.000000 0.000000  0.000000
33  5.00 0.000000  3.333333  3.333333  5.000000 0.000000 3.333333  3.333333
34  5.00 0.000000  9.999998  3.333333  0.000000 0.000000 3.333333  0.744370
35  4.10 9.999998  4.700000  6.666666  3.750000 0.000000 7.827667  6.666666
36  6.30 9.999998  9.999998  6.666666  6.250000 2.233333 6.666666  2.955702
37  5.20 4.999998  6.600000  3.333333  3.633403 1.100000 3.314128  3.333333
38  5.00 3.333333  6.400000  6.666666  2.844997 0.000000 4.429657  1.485166
39  3.10 4.999998  4.200000  5.000000  3.750000 0.000000 6.164304  3.333333
40  4.10 9.999998  6.666666  3.333333  5.000000 0.000000 4.938089  2.233333
41  5.00 9.999998  6.666666  1.666666  5.000000 0.000000 6.666666  0.368500
42  5.00 7.700000  6.666666  8.399997  6.250000 4.358243 9.999998  4.141377
43  5.00 6.200000  9.999998  6.060997  5.000000 2.782771 6.666666  4.974739
44  5.60 4.900000  0.000000  0.000000  6.555647 4.055463 6.666666  3.821796
45  5.70 4.800000  0.000000  0.000000  6.555647 4.055463 0.000000  0.000000
46  7.50 9.999998  7.900000  6.666666  3.750000 9.999998 7.631891  6.666666
47  2.50 0.000000  6.666666  3.333333  2.500000 0.000000 0.000000  0.000000
48  8.90 9.999998  9.700000  6.666666  5.000000 9.999998 9.556024  6.666666
49  7.60 0.000000 10.000000  0.000000  5.000000 1.100000 6.666666  1.099999
50  7.80 9.999998  6.666666  6.666666  5.000000 3.333333 6.666666  6.666666
51  2.50 0.000000  6.666666  3.333333  5.000000 0.000000 6.666666  3.333333
52  3.80 0.000000  5.100000  0.000000  3.750000 0.000000 6.666666  1.485166
53  5.00 3.333333  3.333333  2.233333  5.000000 3.333333 6.666666  5.566663
54  6.25 3.333333  9.999998  2.955702  6.250000 5.566663 9.999998  6.666666
55  1.25 0.000000  3.333333  0.000000  2.500000 0.000000 0.000000  0.000000
56  1.25 0.000000  4.700000  0.736999  2.500000 0.000000 3.333333  3.333333
57  1.25 0.000000  6.666666  0.000000  2.500000 0.000000 5.228375  0.000000
58  7.50 7.766664  9.999998  6.666666  7.500000 3.333333 9.999998  6.666666
59  2.50 0.000000  6.666666  4.433333  5.000000 0.000000 6.666666  1.485166
60  7.50 9.999998  9.999998 10.000000  8.750000 9.999998 9.999998 10.000000
61  1.25 0.000000  0.000000  0.000000  1.250000 0.000000 0.000000  0.000000
62  1.25 0.000000  0.000000  0.000000  0.000000 0.000000 0.000000  0.000000
63  2.50 0.000000  0.000000  0.000000  0.000000 0.000000 6.666666  2.948164
64  6.25 2.233299  6.666666  2.970332  3.750000 3.333299 6.666666  3.333333
65  7.50 9.999998  9.999998 10.000000  7.500000 9.999998 9.999998 10.000000
66  5.00 0.000000  6.100000  0.000000  5.000000 3.333333 9.999998  3.333333
67  7.50 9.999998  9.999998 10.000000  3.750000 9.999998 9.999998 10.000000
68  4.90 2.233333  9.999998  0.000000  5.000000 0.000000 3.621989  3.333333
69  5.00 0.000000  8.200000  0.000000  5.000000 0.000000 0.000000  0.000000
70  2.90 3.333333  6.666666  3.333333  2.500000 3.333333 6.666666  3.333333
71  5.40 9.999998  6.666666  3.333333  3.750000 6.666666 6.666666  1.485166
72  7.50 8.800000  9.999998  6.066666  7.500000 6.666666 9.999998  6.666666
73  7.50 7.000000  9.999998  6.852998  7.500000 6.348340 6.666666  7.508044
74 10.00 6.666666  9.999998 10.000000 10.000000 6.666666 9.999998 10.000000
75  3.75 3.333333  0.000000  0.000000  1.250000 3.333333 0.000000  0.000000
         x1       x2       x3
1  4.442651 3.637586 2.557615
2  5.384495 5.062595 3.568079
3  5.961005 6.255750 5.224433
4  6.285998 7.567863 6.267495
5  5.863631 6.818924 4.573679
6  5.533389 5.135798 3.892270
7  5.308268 5.075174 3.316213
8  5.347108 4.852030 4.263183
9  5.521461 5.241747 4.115168
10 5.828946 5.370638 4.446216
11 5.916202 6.423247 3.791545
12 5.398163 6.246107 4.535708
13 6.622736 7.872074 4.906154
14 5.204007 5.225747 4.561047
15 5.509388 6.202536 4.586286
16 5.262690 5.820083 3.948911
17 4.700480 5.023881 4.394491
18 5.209486 4.465908 4.510268
19 5.916202 6.732211 5.829084
20 6.523562 6.992096 6.424591
21 6.238325 6.746412 5.741711
22 5.976351 6.712956 5.948168
23 5.631212 5.937536 5.686755
24 6.033086 6.093570 4.611429
25 6.196444 6.704414 5.475261
26 4.248495 2.708050 1.740830
27 5.141664 4.564348 2.255134
28 4.174387 3.688879 3.046927
29 4.382027 2.890372 1.711279
30 4.290459 1.609438 1.001674
31 4.934474 4.234107 1.418971
32 3.850148 1.945910 2.345229
33 5.181784 4.394449 3.167167
34 5.062595 4.595120 3.834970
35 4.691348 4.143135 2.255134
36 4.248495 3.367296 3.217506
37 5.564520 5.236442 2.677633
38 4.727388 3.610918 1.418971
39 4.143135 2.302585 1.418971
40 4.317488 4.955827 4.249888
41 5.141664 4.430817 3.046927
42 4.488636 3.465736 2.013579
43 4.615121 4.941642 2.255134
44 3.850148 2.397895 1.740830
45 3.970292 2.397895 1.050741
46 3.784190 3.091042 2.113313
47 3.806662 2.079442 2.137561
48 4.532599 3.610918 1.587802
49 5.117994 4.934474 3.834970
50 5.049856 5.111988 4.381490
51 5.393628 5.638355 4.169451
52 4.477337 3.931826 2.474671
53 5.257495 5.840642 5.001796
54 5.379897 5.505332 3.299937
55 5.298317 6.274762 4.381490
56 4.859812 5.669881 3.537416
57 4.969813 5.564520 4.510268
58 6.011267 6.253829 5.001796
59 5.075174 5.252273 5.350708
60 6.736967 7.125283 6.330518
61 5.225747 5.451038 3.167167
62 4.025352 1.791759 2.657972
63 4.234107 2.708050 2.474671
64 4.644391 5.564520 3.046927
65 4.418841 4.941642 3.380653
66 4.262680 4.219508 4.368462
67 4.875197 4.700480 3.834970
68 4.189655 1.386294 1.418971
69 4.521789 4.127134 2.113313
70 4.653960 3.555348 1.881917
71 4.477337 3.091042 1.987909
72 5.337538 5.631212 3.491004
73 6.129050 6.403574 5.001796
74 5.003946 4.962845 3.976994
75 4.488636 4.897840 2.867566

Measurement Model

model <- '

    ind60 =~ x1 + x2 + x3
    dem60 =~ y1 + y2 + y3 + y4
    dem65 =~ y5 + y6 + y7 + y8
'
Model <- sem(model = model, data = PoliticalDemocracy)
GoF = c("srmr", "rmsea", "tli", "cfi") 
fitmeasures(Model, fit.measures = GoF) 
 srmr rmsea   tli   cfi 
0.055 0.101 0.938 0.953 
summary(Model, standardized = TRUE, rsquare = TRUE,  fit.measures = TRUE)
lavaan 0.6.17 ended normally after 47 iterations

  Estimator                                         ML
  Optimization method                           NLMINB
  Number of model parameters                        25

  Number of observations                            75

Model Test User Model:
                                                      
  Test statistic                                72.462
  Degrees of freedom                                41
  P-value (Chi-square)                           0.002

Model Test Baseline Model:

  Test statistic                               730.654
  Degrees of freedom                                55
  P-value                                        0.000

User Model versus Baseline Model:

  Comparative Fit Index (CFI)                    0.953
  Tucker-Lewis Index (TLI)                       0.938

Loglikelihood and Information Criteria:

  Loglikelihood user model (H0)              -1564.959
  Loglikelihood unrestricted model (H1)      -1528.728
                                                      
  Akaike (AIC)                                3179.918
  Bayesian (BIC)                              3237.855
  Sample-size adjusted Bayesian (SABIC)       3159.062

Root Mean Square Error of Approximation:

  RMSEA                                          0.101
  90 Percent confidence interval - lower         0.061
  90 Percent confidence interval - upper         0.139
  P-value H_0: RMSEA <= 0.050                    0.021
  P-value H_0: RMSEA >= 0.080                    0.827

Standardized Root Mean Square Residual:

  SRMR                                           0.055

Parameter Estimates:

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

Latent Variables:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  ind60 =~                                                              
    x1                1.000                               0.669    0.920
    x2                2.182    0.139   15.714    0.000    1.461    0.973
    x3                1.819    0.152   11.956    0.000    1.218    0.872
  dem60 =~                                                              
    y1                1.000                               2.201    0.845
    y2                1.354    0.175    7.755    0.000    2.980    0.760
    y3                1.044    0.150    6.961    0.000    2.298    0.705
    y4                1.300    0.138    9.412    0.000    2.860    0.860
  dem65 =~                                                              
    y5                1.000                               2.084    0.803
    y6                1.258    0.164    7.651    0.000    2.623    0.783
    y7                1.282    0.158    8.137    0.000    2.673    0.819
    y8                1.310    0.154    8.529    0.000    2.730    0.847

Covariances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  ind60 ~~                                                              
    dem60             0.660    0.206    3.202    0.001    0.448    0.448
    dem65             0.774    0.208    3.715    0.000    0.555    0.555
  dem60 ~~                                                              
    dem65             4.487    0.911    4.924    0.000    0.978    0.978

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .x1                0.082    0.020    4.180    0.000    0.082    0.154
   .x2                0.118    0.070    1.689    0.091    0.118    0.053
   .x3                0.467    0.090    5.174    0.000    0.467    0.240
   .y1                1.942    0.395    4.910    0.000    1.942    0.286
   .y2                6.490    1.185    5.479    0.000    6.490    0.422
   .y3                5.340    0.943    5.662    0.000    5.340    0.503
   .y4                2.887    0.610    4.731    0.000    2.887    0.261
   .y5                2.390    0.447    5.351    0.000    2.390    0.355
   .y6                4.343    0.796    5.456    0.000    4.343    0.387
   .y7                3.510    0.668    5.252    0.000    3.510    0.329
   .y8                2.940    0.586    5.019    0.000    2.940    0.283
    ind60             0.448    0.087    5.169    0.000    1.000    1.000
    dem60             4.845    1.088    4.453    0.000    1.000    1.000
    dem65             4.345    1.051    4.134    0.000    1.000    1.000

R-Square:
                   Estimate
    x1                0.846
    x2                0.947
    x3                0.760
    y1                0.714
    y2                0.578
    y3                0.497
    y4                0.739
    y5                0.645
    y6                0.613
    y7                0.671
    y8                0.717

Structural Model

model <- '

    ind60 =~ x1 + x2 + x3
    dem60 =~ y1 + y2 + y3 + y4
    dem65 =~ y5 + y6 + y7 + y8
    
    dem60 ~ ind60
    dem65 ~ ind60 + dem60
'
Model <- sem(model = model, data = PoliticalDemocracy)
GoF = c("srmr", "rmsea", "tli", "cfi") 
fitmeasures(Model, fit.measures = GoF) 
 srmr rmsea   tli   cfi 
0.055 0.101 0.938 0.953 
summary(Model, standardized = TRUE, rsquare = TRUE,  fit.measures = TRUE)
lavaan 0.6.17 ended normally after 42 iterations

  Estimator                                         ML
  Optimization method                           NLMINB
  Number of model parameters                        25

  Number of observations                            75

Model Test User Model:
                                                      
  Test statistic                                72.462
  Degrees of freedom                                41
  P-value (Chi-square)                           0.002

Model Test Baseline Model:

  Test statistic                               730.654
  Degrees of freedom                                55
  P-value                                        0.000

User Model versus Baseline Model:

  Comparative Fit Index (CFI)                    0.953
  Tucker-Lewis Index (TLI)                       0.938

Loglikelihood and Information Criteria:

  Loglikelihood user model (H0)              -1564.959
  Loglikelihood unrestricted model (H1)      -1528.728
                                                      
  Akaike (AIC)                                3179.918
  Bayesian (BIC)                              3237.855
  Sample-size adjusted Bayesian (SABIC)       3159.062

Root Mean Square Error of Approximation:

  RMSEA                                          0.101
  90 Percent confidence interval - lower         0.061
  90 Percent confidence interval - upper         0.139
  P-value H_0: RMSEA <= 0.050                    0.021
  P-value H_0: RMSEA >= 0.080                    0.827

Standardized Root Mean Square Residual:

  SRMR                                           0.055

Parameter Estimates:

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

Latent Variables:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  ind60 =~                                                              
    x1                1.000                               0.669    0.920
    x2                2.182    0.139   15.714    0.000    1.461    0.973
    x3                1.819    0.152   11.956    0.000    1.218    0.872
  dem60 =~                                                              
    y1                1.000                               2.201    0.845
    y2                1.354    0.175    7.755    0.000    2.980    0.760
    y3                1.044    0.150    6.961    0.000    2.298    0.705
    y4                1.300    0.138    9.412    0.000    2.860    0.860
  dem65 =~                                                              
    y5                1.000                               2.084    0.803
    y6                1.258    0.164    7.651    0.000    2.623    0.783
    y7                1.282    0.158    8.137    0.000    2.673    0.819
    y8                1.310    0.154    8.529    0.000    2.730    0.847

Regressions:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  dem60 ~                                                               
    ind60             1.474    0.392    3.763    0.000    0.448    0.448
  dem65 ~                                                               
    ind60             0.453    0.220    2.064    0.039    0.146    0.146
    dem60             0.864    0.113    7.671    0.000    0.913    0.913

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .x1                0.082    0.020    4.180    0.000    0.082    0.154
   .x2                0.118    0.070    1.689    0.091    0.118    0.053
   .x3                0.467    0.090    5.174    0.000    0.467    0.240
   .y1                1.942    0.395    4.910    0.000    1.942    0.286
   .y2                6.490    1.185    5.479    0.000    6.490    0.422
   .y3                5.340    0.943    5.662    0.000    5.340    0.503
   .y4                2.887    0.610    4.731    0.000    2.887    0.261
   .y5                2.390    0.447    5.351    0.000    2.390    0.355
   .y6                4.343    0.796    5.456    0.000    4.343    0.387
   .y7                3.510    0.668    5.252    0.000    3.510    0.329
   .y8                2.940    0.586    5.019    0.000    2.940    0.283
    ind60             0.448    0.087    5.169    0.000    1.000    1.000
   .dem60             3.872    0.893    4.338    0.000    0.799    0.799
   .dem65             0.115    0.200    0.575    0.565    0.026    0.026

R-Square:
                   Estimate
    x1                0.846
    x2                0.947
    x3                0.760
    y1                0.714
    y2                0.578
    y3                0.497
    y4                0.739
    y5                0.645
    y6                0.613
    y7                0.671
    y8                0.717
    dem60             0.201
    dem65             0.974