Skip to contents

modsem() is a function for estimating interaction effects between latent variables in structural equation models (SEMs). Methods for estimating interaction effects in SEMs can basically be split into two frameworks:

  1. Product Indicator (PI) based approaches ("dblcent", "rca", "uca", "ca", "pind")

  2. Distributionally (DA) based approaches ("lms", "qml").

For the product indicator-based approaches, modsem() is essentially a fancy wrapper for lavaan::sem() which generates the necessary syntax and variables for the estimation of models with latent product indicators.

The distributionally based approaches are implemented separately and are not estimated using lavaan::sem(), but rather using custom functions (largely written in C++ for performance reasons). For greater control, it is advised that you use one of the sub-functions (modsem_pi, modsem_da, modsem_mplus) directly, as passing additional arguments to them via modsem() can lead to unexpected behavior.

Usage

modsem(model.syntax = NULL, data = NULL, method = "dblcent", ...)

Arguments

model.syntax

lavaan syntax

data

dataframe

method

method to use:

"dblcent"

double centering approach (passed to lavaan).

"ca"

constrained approach (passed to lavaan).

"rca"

residual centering approach (passed to lavaan).

"uca"

unconstrained approach (passed to lavaan).

"pind"

prod ind approach, with no constraints or centering (passed to lavaan).

"lms"

latent moderated structural equations (not passed to lavaan).

"qml"

quasi maximum likelihood estimation (not passed to lavaan).

"custom"

use parameters specified in the function call (passed to lavaan).

"mplus"

estimate model through Mplus.

...

arguments passed to other functions depending on the method (see modsem_pi, modsem_da, and modsem_mplus)

Value

modsem object with class modsem_pi, modsem_da, or modsem_mplus

Examples

library(modsem)
# For more examples, check README and/or GitHub.
# One interaction
m1 <- '
  # Outer Model
  X =~ x1 + x2 +x3
  Y =~ y1 + y2 + y3
  Z =~ z1 + z2 + z3

  # Inner model
  Y ~ X + Z + X:Z
'

# Double centering approach
est1 <- modsem(m1, oneInt)
summary(est1)
#> Estimating baseline model (H0)
#> modsem (version 1.0.13, approach = dblcent):
#> 
#> Interaction Model Fit Measures (H1):
#>   Loglikelihood                              -26807.61 
#>   Akaike (AIC)                                53735.22 
#>   Bayesian (BIC)                              54071.28 
#>   Chi-square                                    122.92 
#>   Degrees of Freedom                               111 
#>   P-value (Chi-square)                           0.207 
#>   RMSEA                                          0.007 
#>   CFI                                            1.000 
#>   SRMR                                           0.008 
#> 
#> Fit Measures for Baseline Model (H0):
#>   Loglikelihood                              -27137.74 
#>   Akaike (AIC)                                54393.48 
#>   Bayesian (BIC)                              54723.93 
#>   Chi-square                                    783.18 
#>   Degrees of Freedom                               112 
#>   P-value (Chi-square)                           0.000 
#>   RMSEA                                          0.055 
#>   CFI                                            0.987 
#>   SRMR                                           0.141 
#> 
#> Comparative Fit to H0 (LRT test):
#>   Chi-square diff                              660.257 
#>   Degrees of freedom diff                            1 
#>   P-value (LRT)                                  0.000 
#> 
#> R-Squared Interaction Model (H1):
#>   Y                                              0.602 
#> R-Squared Baseline Model (H0):
#>   Y                                              0.397 
#> R-Squared Change (H1 - H0):
#>   Y                                              0.204 
#> 
#> lavaan 0.6-19 ended normally after 161 iterations
#> 
#>   Estimator                                         ML
#>   Optimization method                           NLMINB
#>   Number of model parameters                        60
#> 
#>   Number of observations                          2000
#> 
#> Model Test User Model:
#>                                                       
#>   Test statistic                               122.924
#>   Degrees of freedom                               111
#>   P-value (Chi-square)                           0.207
#> 
#> Parameter Estimates:
#> 
#>   Standard errors                             Standard
#>   Information                                 Expected
#>   Information saturated (h1) model          Structured
#> 
#> Latent Variables:
#>                    Estimate  Std.Err  z-value  P(>|z|)
#>   X =~                                                
#>     x1                1.000                           
#>     x2                0.804    0.013   63.612    0.000
#>     x3                0.916    0.014   67.144    0.000
#>   Y =~                                                
#>     y1                1.000                           
#>     y2                0.798    0.007  107.428    0.000
#>     y3                0.899    0.008  112.453    0.000
#>   Z =~                                                
#>     z1                1.000                           
#>     z2                0.812    0.013   64.763    0.000
#>     z3                0.882    0.013   67.014    0.000
#>   XZ =~                                               
#>     x1z1              1.000                           
#>     x2z1              0.805    0.013   60.636    0.000
#>     x3z1              0.877    0.014   62.680    0.000
#>     x1z2              0.793    0.013   59.343    0.000
#>     x2z2              0.646    0.015   43.672    0.000
#>     x3z2              0.706    0.016   44.292    0.000
#>     x1z3              0.887    0.014   63.700    0.000
#>     x2z3              0.716    0.016   45.645    0.000
#>     x3z3              0.781    0.017   45.339    0.000
#> 
#> Regressions:
#>                    Estimate  Std.Err  z-value  P(>|z|)
#>   Y ~                                                 
#>     X                 0.675    0.027   25.379    0.000
#>     Z                 0.561    0.026   21.606    0.000
#>     XZ                0.702    0.027   26.360    0.000
#> 
#> Covariances:
#>                    Estimate  Std.Err  z-value  P(>|z|)
#>  .x1z1 ~~                                             
#>    .x1z2              0.115    0.008   14.802    0.000
#>    .x1z3              0.114    0.008   13.947    0.000
#>    .x2z1              0.125    0.008   16.095    0.000
#>    .x3z1              0.140    0.009   16.135    0.000
#>  .x1z2 ~~                                             
#>    .x1z3              0.103    0.007   14.675    0.000
#>    .x2z2              0.128    0.006   20.850    0.000
#>    .x3z2              0.146    0.007   21.243    0.000
#>  .x1z3 ~~                                             
#>    .x2z3              0.116    0.007   17.818    0.000
#>    .x3z3              0.135    0.007   18.335    0.000
#>  .x2z1 ~~                                             
#>    .x2z2              0.135    0.006   20.905    0.000
#>    .x2z3              0.145    0.007   21.145    0.000
#>    .x3z1              0.114    0.007   16.058    0.000
#>  .x2z2 ~~                                             
#>    .x2z3              0.117    0.006   20.419    0.000
#>    .x3z2              0.116    0.006   20.586    0.000
#>  .x2z3 ~~                                             
#>    .x3z3              0.109    0.006   18.059    0.000
#>  .x3z1 ~~                                             
#>    .x3z2              0.138    0.007   19.331    0.000
#>    .x3z3              0.158    0.008   20.269    0.000
#>  .x3z2 ~~                                             
#>    .x3z3              0.131    0.007   19.958    0.000
#>   X ~~                                                
#>     Z                 0.201    0.024    8.271    0.000
#>     XZ                0.016    0.025    0.628    0.530
#>   Z ~~                                                
#>     XZ                0.062    0.025    2.449    0.014
#> 
#> Variances:
#>                    Estimate  Std.Err  z-value  P(>|z|)
#>    .x1                0.160    0.009   17.871    0.000
#>    .x2                0.162    0.007   22.969    0.000
#>    .x3                0.163    0.008   20.161    0.000
#>    .y1                0.159    0.009   17.896    0.000
#>    .y2                0.154    0.007   22.640    0.000
#>    .y3                0.164    0.008   20.698    0.000
#>    .z1                0.168    0.009   18.143    0.000
#>    .z2                0.158    0.007   22.264    0.000
#>    .z3                0.158    0.008   20.389    0.000
#>    .x1z1              0.311    0.014   22.227    0.000
#>    .x2z1              0.292    0.011   27.287    0.000
#>    .x3z1              0.327    0.012   26.275    0.000
#>    .x1z2              0.290    0.011   26.910    0.000
#>    .x2z2              0.239    0.008   29.770    0.000
#>    .x3z2              0.270    0.009   29.117    0.000
#>    .x1z3              0.272    0.012   23.586    0.000
#>    .x2z3              0.245    0.009   27.979    0.000
#>    .x3z3              0.297    0.011   28.154    0.000
#>     X                 0.981    0.036   26.895    0.000
#>    .Y                 0.990    0.038   25.926    0.000
#>     Z                 1.016    0.038   26.856    0.000
#>     XZ                1.045    0.044   24.004    0.000
#> 

# \dontrun{
# The Constrained Approach
est1_ca <- modsem(m1, oneInt, method = "ca")
summary(est1_ca)
#> Estimating baseline model (H0)
#> modsem (version 1.0.13, approach = ca):
#> 
#> Interaction Model Fit Measures (H1):
#>   Loglikelihood                              -24339.32 
#>   Akaike (AIC)                                48746.65 
#>   Bayesian (BIC)                              48937.08 
#>   Chi-square                                     60.40 
#>   Degrees of Freedom                                56 
#>   P-value (Chi-square)                           0.320 
#>   RMSEA                                          0.006 
#>   CFI                                            1.000 
#>   SRMR                                           0.020 
#> 
#> Fit Measures for Baseline Model (H0):
#>   Loglikelihood                              -24669.20 
#>   Akaike (AIC)                                49404.40 
#>   Bayesian (BIC)                              49589.23 
#>   Chi-square                                    720.15 
#>   Degrees of Freedom                                57 
#>   P-value (Chi-square)                           0.000 
#>   RMSEA                                          0.076 
#>   CFI                                            0.972 
#>   SRMR                                           0.124 
#> 
#> Comparative Fit to H0 (LRT test):
#>   Chi-square diff                              659.749 
#>   Degrees of freedom diff                            1 
#>   P-value (LRT)                                  0.000 
#> 
#> R-Squared Interaction Model (H1):
#>   Y                                              0.594 
#> R-Squared Baseline Model (H0):
#>   Y                                              0.393 
#> R-Squared Change (H1 - H0):
#>   Y                                              0.201 
#> 
#> lavaan 0.6-19 ended normally after 286 iterations
#> 
#>   Estimator                                         ML
#>   Optimization method                           NLMINB
#>   Number of model parameters                        43
#>   Row rank of the constraints matrix                 9
#> 
#>   Number of observations                          2000
#> 
#> Model Test User Model:
#>                                                       
#>   Test statistic                                60.401
#>   Degrees of freedom                                56
#>   P-value (Chi-square)                           0.320
#> 
#> Parameter Estimates:
#> 
#>   Standard errors                             Standard
#>   Information                                 Expected
#>   Information saturated (h1) model          Structured
#> 
#> Latent Variables:
#>                    Estimate  Std.Err  z-value  P(>|z|)
#>   X =~                                                
#>     x1     (l_1_X)    1.000                           
#>     x2     (l_2_X)    0.805    0.011   73.101    0.000
#>     x3     (l_3_X)    0.912    0.012   76.636    0.000
#>   Y =~                                                
#>     y1     (l_1_Y)    1.000                           
#>     y2     (l_2_Y)    0.798    0.008  106.156    0.000
#>     y3     (l_3_Y)    0.899    0.008  111.106    0.000
#>   Z =~                                                
#>     z1     (l_1_Z)    1.000                           
#>     z2     (l_2_Z)    0.813    0.011   74.076    0.000
#>     z3     (l_3_Z)    0.878    0.011   76.574    0.000
#>   XZ =~                                               
#>     x1z1    (l_11)    1.000                           
#>     x2z2    (l_22)    0.654    0.010   62.981    0.000
#>     x3z3    (l_33)    0.801    0.012   65.421    0.000
#> 
#> Regressions:
#>                    Estimate  Std.Err  z-value  P(>|z|)
#>   Y ~                                                 
#>     X       (G_X_)    0.678    0.026   25.602    0.000
#>     Z       (G_Z_)    0.565    0.026   21.868    0.000
#>     XZ      (G_XZ)    0.715    0.026   27.094    0.000
#> 
#> Covariances:
#>                    Estimate  Std.Err  z-value  P(>|z|)
#>   X ~~                                                
#>     Z      (C_X_Z)    0.198    0.022    9.042    0.000
#>     XZ     (C_X_X)    0.000       NA                  
#>   Z ~~                                                
#>     XZ      (C_Z_)    0.000                           
#>  .x1z1 ~~                                             
#>    .x2z2              0.000                           
#>    .x3z3              0.000                           
#>  .x2z2 ~~                                             
#>    .x3z3              0.000                           
#> 
#> Intercepts:
#>                    Estimate  Std.Err  z-value  P(>|z|)
#>     XZ      (M_XZ)    0.198    0.022    9.042    0.000
#>    .x1                1.023    0.024   43.002    0.000
#>    .x2                1.215    0.020   60.936    0.000
#>    .x3                0.919    0.022   41.603    0.000
#>    .y1                1.039    0.040   26.293    0.000
#>    .y2                1.222    0.032   38.225    0.000
#>    .y3                0.955    0.036   26.709    0.000
#>    .z1                1.011    0.024   41.726    0.000
#>    .z2                1.206    0.020   59.286    0.000
#>    .z3                0.916    0.022   42.229    0.000
#>    .x1z1              0.012    0.034    0.352    0.725
#>    .x2z2              0.001    0.023    0.031    0.975
#>    .x3z3             -0.007    0.028   -0.262    0.793
#> 
#> Variances:
#>                    Estimate  Std.Err  z-value  P(>|z|)
#>     X       (Vr_X)    0.976    0.029   33.284    0.000
#>    .Y       (Zt_Y)    0.987    0.038   25.711    0.000
#>     Z       (Vr_Z)    1.011    0.030   33.294    0.000
#>     XZ      (V_XZ)    1.026    0.032   32.214    0.000
#>    .x1     (Vr_x1)    0.156    0.008   19.174    0.000
#>    .x2     (Vr_x2)    0.163    0.006   25.240    0.000
#>    .x3     (Vr_x3)    0.165    0.007   22.239    0.000
#>    .y1     (Vr_y1)    0.159    0.009   17.881    0.000
#>    .y2     (Vr_y2)    0.154    0.007   22.631    0.000
#>    .y3     (Vr_y3)    0.164    0.008   20.686    0.000
#>    .z1     (Vr_z1)    0.164    0.008   19.449    0.000
#>    .z2     (Vr_z2)    0.159    0.007   24.247    0.000
#>    .z3     (Vr_z3)    0.160    0.007   22.514    0.000
#>    .x1z1    (V_11)    0.343    0.011   30.345    0.000
#>    .x2z2    (V_22)    0.236    0.006   37.239    0.000
#>    .x3z3    (V_33)    0.285    0.008   34.438    0.000
#> 
#> Constraints:
#>                                                |Slack|
#>     Var_XZ - ((Var_X)*(Var_Z)+(Cov_X_Z)^2)       0.000
#>     Cov_X_XZ - 0                                 0.000
#>     Cov_Z_XZ - 0                                 0.000
#>     V_11-(_1_X^2*(V_X)*V_1+_1_Z^2*(V_Z)*V_1+V    0.000
#>     V_22-(_2_X^2*(V_X)*V_2+_2_Z^2*(V_Z)*V_2+V    0.000
#>     V_33-(_3_X^2*(V_X)*V_3+_3_Z^2*(V_Z)*V_3+V    0.000
#>     lambda_x1z1_XZ-(lambda_x1_X*lambda_z1_Z)     0.000
#>     lambda_x2z2_XZ-(lambda_x2_X*lambda_z2_Z)     0.000
#>     lambda_x3z3_XZ-(lambda_x3_X*lambda_z3_Z)     0.000
#>     Mean_XZ - ((Cov_X_Z))                        0.000
#> 

# LMS approach
est1_lms <- modsem(m1, oneInt, method = "lms")
summary(est1_lms)
#> 
#> modsem (1.0.13) ended normally after 41 iterations
#> 
#>   Estimator                                        LMS
#>   Optimization method                       EMA-NLMINB
#>   Number of model parameters                        31
#>                                                       
#>   Number of observations                          2000
#>  
#> Loglikelihood and Information Criteria:
#>   Loglikelihood                              -17493.60
#>   Akaike (AIC)                                35049.20
#>   Bayesian (BIC)                              35222.83
#>  
#> Numerical Integration:
#>   Points of integration (per dim)                   24
#>   Dimensions                                         1
#>   Total points of integration                       24
#>  
#> Fit Measures for Baseline Model (H0):
#>                                               Standard
#>   Chi-square                                     17.52
#>   Degrees of Freedom (Chi-square)                   24
#>   P-value (Chi-square)                           0.826
#>   RMSEA                                          0.000
#>                                                       
#>   Loglikelihood                              -17831.87
#>   Akaike (AIC)                                35723.75
#>   Bayesian (BIC)                              35891.78
#>  
#> Comparative Fit to H0 (LRT test):
#>   Loglikelihood change                          338.27
#>   Difference test (D)                           676.55
#>   Degrees of freedom (D)                             1
#>   P-value (D)                                    0.000
#>  
#> R-Squared Interaction Model (H1):
#>   Y                                              0.599
#> R-Squared Baseline Model (H0):
#>   Y                                              0.395
#> R-Squared Change (H1 - H0):
#>   Y                                              0.204
#> 
#> Parameter Estimates:
#>   Coefficients                          unstandardized
#>   Information                                 observed
#>   Standard errors                             standard
#>  
#> Latent Variables:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>   X =~          
#>     x1              1.000                             
#>     x2              0.803      0.013   63.813    0.000
#>     x3              0.914      0.014   67.611    0.000
#>   Z =~          
#>     z1              1.000                             
#>     z2              0.810      0.012   65.087    0.000
#>     z3              0.881      0.013   67.615    0.000
#>   Y =~          
#>     y1              1.000                             
#>     y2              0.798      0.007  107.550    0.000
#>     y3              0.899      0.008  112.586    0.000
#> 
#> Regressions:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>   Y ~           
#>     X               0.673      0.031   21.688    0.000
#>     Z               0.569      0.030   18.734    0.000
#>     X:Z             0.718      0.028   25.826    0.000
#> 
#> Intercepts:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>    .x1              1.023      0.024   42.804    0.000
#>    .x2              1.216      0.020   60.873    0.000
#>    .x3              0.920      0.022   41.400    0.000
#>    .z1              1.012      0.024   41.578    0.000
#>    .z2              1.206      0.020   59.274    0.000
#>    .z3              0.916      0.022   42.067    0.000
#>    .y1              1.037      0.033   31.398    0.000
#>    .y2              1.220      0.027   45.424    0.000
#>    .y3              0.954      0.030   31.806    0.000
#> 
#> Covariances:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>   X ~~          
#>     Z               0.200      0.024    8.240    0.000
#> 
#> Variances:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>    .x1              0.158      0.009   18.171    0.000
#>    .x2              0.162      0.007   23.160    0.000
#>    .x3              0.164      0.008   20.758    0.000
#>    .z1              0.167      0.009   18.504    0.000
#>    .z2              0.160      0.007   22.680    0.000
#>    .z3              0.158      0.008   20.779    0.000
#>    .y1              0.160      0.009   18.011    0.000
#>    .y2              0.154      0.007   22.687    0.000
#>    .y3              0.164      0.008   20.683    0.000
#>     X               0.981      0.036   26.969    0.000
#>     Z               1.017      0.038   26.932    0.000
#>    .Y               0.980      0.038   25.938    0.000
#> 

# QML approach
est1_qml <- modsem(m1, oneInt, method = "qml")
summary(est1_qml)
#> 
#> modsem (1.0.13) ended normally after 92 iterations
#> 
#>   Estimator                                        QML
#>   Optimization method                           NLMINB
#>   Number of model parameters                        31
#>                                                       
#>   Number of observations                          2000
#>  
#> Loglikelihood and Information Criteria:
#>   Loglikelihood                              -17493.65
#>   Akaike (AIC)                                35049.29
#>   Bayesian (BIC)                              35222.92
#>  
#> Fit Measures for Baseline Model (H0):
#>                                               Standard
#>   Chi-square                                     17.52
#>   Degrees of Freedom (Chi-square)                   24
#>   P-value (Chi-square)                           0.826
#>   RMSEA                                          0.000
#>                                                       
#>   Loglikelihood                              -17831.87
#>   Akaike (AIC)                                35723.75
#>   Bayesian (BIC)                              35891.78
#>  
#> Comparative Fit to H0 (LRT test):
#>   Loglikelihood change                          338.23
#>   Difference test (D)                           676.46
#>   Degrees of freedom (D)                             1
#>   P-value (D)                                    0.000
#>  
#> R-Squared Interaction Model (H1):
#>   Y                                              0.599
#> R-Squared Baseline Model (H0):
#>   Y                                              0.395
#> R-Squared Change (H1 - H0):
#>   Y                                              0.204
#> 
#> Parameter Estimates:
#>   Coefficients                          unstandardized
#>   Information                                 observed
#>   Standard errors                             standard
#>  
#> Latent Variables:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>   X =~          
#>     x1              1.000                             
#>     x2              0.804      0.013   63.895    0.000
#>     x3              0.914      0.013   67.709    0.000
#>   Z =~          
#>     z1              1.000                             
#>     z2              0.810      0.012   65.077    0.000
#>     z3              0.881      0.013   67.604    0.000
#>   Y =~          
#>     y1              1.000                             
#>     y2              0.798      0.007  107.533    0.000
#>     y3              0.899      0.008  112.562    0.000
#> 
#> Regressions:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>   Y ~           
#>     X               0.674      0.031   21.683    0.000
#>     Z               0.569      0.030   18.733    0.000
#>     X:Z             0.719      0.028   25.831    0.000
#> 
#> Intercepts:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>    .x1              1.023      0.024   42.841    0.000
#>    .x2              1.216      0.020   60.921    0.000
#>    .x3              0.920      0.022   41.435    0.000
#>    .z1              1.012      0.024   41.575    0.000
#>    .z2              1.206      0.020   59.268    0.000
#>    .z3              0.916      0.022   42.062    0.000
#>    .y1              1.037      0.033   31.413    0.000
#>    .y2              1.221      0.027   45.435    0.000
#>    .y3              0.954      0.030   31.817    0.000
#> 
#> Covariances:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>   X ~~          
#>     Z               0.200      0.024    8.240    0.000
#> 
#> Variances:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>    .x1              0.158      0.009   18.145    0.000
#>    .x2              0.162      0.007   23.153    0.000
#>    .x3              0.165      0.008   20.766    0.000
#>    .z1              0.167      0.009   18.507    0.000
#>    .z2              0.160      0.007   22.676    0.000
#>    .z3              0.158      0.008   20.771    0.000
#>    .y1              0.160      0.009   18.012    0.000
#>    .y2              0.154      0.007   22.682    0.000
#>    .y3              0.164      0.008   20.679    0.000
#>     X               0.983      0.036   26.974    0.000
#>     Z               1.017      0.038   26.928    0.000
#>    .Y               0.980      0.038   25.910    0.000
#> 
# }

# Theory Of Planned Behavior
tpb <- '
# Outer Model (Based on Hagger et al., 2007)
  ATT =~ att1 + att2 + att3 + att4 + att5
  SN =~ sn1 + sn2
  PBC =~ pbc1 + pbc2 + pbc3
  INT =~ int1 + int2 + int3
  BEH =~ b1 + b2

# Inner Model (Based on Steinmetz et al., 2011)
  INT ~ ATT + SN + PBC
  BEH ~ INT + PBC
  BEH ~ INT:PBC
'

# Double centering approach
est_tpb <- modsem(tpb, data = TPB)
summary(est_tpb)
#> Estimating baseline model (H0)
#> modsem (version 1.0.13, approach = dblcent):
#> 
#> Interaction Model Fit Measures (H1):
#>   Loglikelihood                              -34958.88 
#>   Akaike (AIC)                                70073.77 
#>   Bayesian (BIC)                              70510.64 
#>   Chi-square                                    207.61 
#>   Degrees of Freedom                               222 
#>   P-value (Chi-square)                           0.747 
#>   RMSEA                                          0.000 
#>   CFI                                            1.000 
#>   SRMR                                           0.010 
#> 
#> Fit Measures for Baseline Model (H0):
#>   Loglikelihood                              -35025.66 
#>   Akaike (AIC)                                70205.32 
#>   Bayesian (BIC)                              70636.59 
#>   Chi-square                                    341.17 
#>   Degrees of Freedom                               223 
#>   P-value (Chi-square)                           0.000 
#>   RMSEA                                          0.016 
#>   CFI                                            0.998 
#>   SRMR                                           0.048 
#> 
#> Comparative Fit to H0 (LRT test):
#>   Chi-square diff                              133.551 
#>   Degrees of freedom diff                            1 
#>   P-value (LRT)                                  0.000 
#> 
#> R-Squared Interaction Model (H1):
#>   INT                                            0.367 
#>   BEH                                            0.278 
#> R-Squared Baseline Model (H0):
#>   INT                                            0.367 
#>   BEH                                            0.211 
#> R-Squared Change (H1 - H0):
#>   INT                                           -0.000 
#>   BEH                                            0.067 
#> 
#> lavaan 0.6-19 ended normally after 173 iterations
#> 
#>   Estimator                                         ML
#>   Optimization method                           NLMINB
#>   Number of model parameters                        78
#> 
#>   Number of observations                          2000
#> 
#> Model Test User Model:
#>                                                       
#>   Test statistic                               207.615
#>   Degrees of freedom                               222
#>   P-value (Chi-square)                           0.747
#> 
#> Parameter Estimates:
#> 
#>   Standard errors                             Standard
#>   Information                                 Expected
#>   Information saturated (h1) model          Structured
#> 
#> Latent Variables:
#>                    Estimate  Std.Err  z-value  P(>|z|)
#>   ATT =~                                              
#>     att1              1.000                           
#>     att2              0.878    0.012   71.509    0.000
#>     att3              0.789    0.012   66.368    0.000
#>     att4              0.695    0.011   61.017    0.000
#>     att5              0.887    0.013   70.884    0.000
#>   SN =~                                               
#>     sn1               1.000                           
#>     sn2               0.889    0.017   52.553    0.000
#>   PBC =~                                              
#>     pbc1              1.000                           
#>     pbc2              0.912    0.013   69.500    0.000
#>     pbc3              0.801    0.012   65.830    0.000
#>   INT =~                                              
#>     int1              1.000                           
#>     int2              0.914    0.016   58.982    0.000
#>     int3              0.808    0.015   55.547    0.000
#>   BEH =~                                              
#>     b1                1.000                           
#>     b2                0.960    0.030   31.561    0.000
#>   INTPBC =~                                           
#>     int1pbc1          1.000                           
#>     int2pbc1          0.931    0.015   63.809    0.000
#>     int3pbc1          0.774    0.013   60.107    0.000
#>     int1pbc2          0.893    0.013   68.173    0.000
#>     int2pbc2          0.826    0.017   48.845    0.000
#>     int3pbc2          0.690    0.015   45.300    0.000
#>     int1pbc3          0.799    0.012   67.008    0.000
#>     int2pbc3          0.738    0.015   47.809    0.000
#>     int3pbc3          0.622    0.014   45.465    0.000
#> 
#> Regressions:
#>                    Estimate  Std.Err  z-value  P(>|z|)
#>   INT ~                                               
#>     ATT               0.213    0.026    8.170    0.000
#>     SN                0.177    0.028    6.416    0.000
#>     PBC               0.217    0.030    7.340    0.000
#>   BEH ~                                               
#>     INT               0.191    0.024    7.817    0.000
#>     PBC               0.230    0.022   10.507    0.000
#>     INTPBC            0.204    0.018   11.425    0.000
#> 
#> Covariances:
#>                    Estimate  Std.Err  z-value  P(>|z|)
#>  .int1pbc1 ~~                                         
#>    .int1pbc2          0.126    0.009   14.768    0.000
#>    .int1pbc3          0.102    0.007   13.794    0.000
#>    .int2pbc1          0.104    0.007   14.608    0.000
#>    .int3pbc1          0.091    0.006   14.109    0.000
#>  .int1pbc2 ~~                                         
#>    .int1pbc3          0.095    0.007   13.852    0.000
#>    .int2pbc2          0.128    0.007   19.320    0.000
#>    .int3pbc2          0.119    0.006   19.402    0.000
#>  .int1pbc3 ~~                                         
#>    .int2pbc3          0.110    0.006   19.911    0.000
#>    .int3pbc3          0.097    0.005   19.415    0.000
#>  .int2pbc1 ~~                                         
#>    .int2pbc2          0.152    0.008   18.665    0.000
#>    .int2pbc3          0.138    0.007   18.779    0.000
#>    .int3pbc1          0.082    0.006   13.951    0.000
#>  .int2pbc2 ~~                                         
#>    .int2pbc3          0.121    0.007   18.361    0.000
#>    .int3pbc2          0.104    0.005   19.047    0.000
#>  .int2pbc3 ~~                                         
#>    .int3pbc3          0.087    0.005   19.180    0.000
#>  .int3pbc1 ~~                                         
#>    .int3pbc2          0.139    0.007   21.210    0.000
#>    .int3pbc3          0.123    0.006   21.059    0.000
#>  .int3pbc2 ~~                                         
#>    .int3pbc3          0.114    0.005   21.021    0.000
#>   ATT ~~                                              
#>     SN                0.629    0.029   21.977    0.000
#>     PBC               0.678    0.029   23.721    0.000
#>     INTPBC            0.086    0.024    3.519    0.000
#>   SN ~~                                               
#>     PBC               0.678    0.029   23.338    0.000
#>     INTPBC            0.055    0.025    2.230    0.026
#>   PBC ~~                                              
#>     INTPBC            0.087    0.024    3.609    0.000
#> 
#> Variances:
#>                    Estimate  Std.Err  z-value  P(>|z|)
#>    .att1              0.167    0.007   23.528    0.000
#>    .att2              0.150    0.006   24.693    0.000
#>    .att3              0.160    0.006   26.378    0.000
#>    .att4              0.163    0.006   27.649    0.000
#>    .att5              0.159    0.006   24.930    0.000
#>    .sn1               0.178    0.015   12.110    0.000
#>    .sn2               0.156    0.012   13.221    0.000
#>    .pbc1              0.145    0.008   18.440    0.000
#>    .pbc2              0.160    0.007   21.547    0.000
#>    .pbc3              0.154    0.007   23.716    0.000
#>    .int1              0.158    0.009   18.152    0.000
#>    .int2              0.160    0.008   20.345    0.000
#>    .int3              0.167    0.007   23.414    0.000
#>    .b1                0.186    0.018   10.058    0.000
#>    .b2                0.135    0.017    8.080    0.000
#>    .int1pbc1          0.266    0.013   20.971    0.000
#>    .int2pbc1          0.292    0.012   24.421    0.000
#>    .int3pbc1          0.251    0.010   26.305    0.000
#>    .int1pbc2          0.290    0.012   24.929    0.000
#>    .int2pbc2          0.269    0.010   26.701    0.000
#>    .int3pbc2          0.253    0.009   29.445    0.000
#>    .int1pbc3          0.223    0.009   24.431    0.000
#>    .int2pbc3          0.234    0.008   27.633    0.000
#>    .int3pbc3          0.203    0.007   29.288    0.000
#>     ATT               0.998    0.037   27.138    0.000
#>     SN                0.987    0.039   25.394    0.000
#>     PBC               0.962    0.035   27.260    0.000
#>    .INT               0.490    0.020   24.638    0.000
#>    .BEH               0.455    0.023   20.068    0.000
#>     INTPBC            1.020    0.041   24.612    0.000
#> 

# \dontrun{
# The Constrained Approach
est_tpb_ca <- modsem(tpb, data = TPB, method = "ca")
summary(est_tpb_ca)
#> Estimating baseline model (H0)
#> modsem (version 1.0.13, approach = ca):
#> 
#> Interaction Model Fit Measures (H1):
#>   Loglikelihood                              -32849.60 
#>   Akaike (AIC)                                65817.20 
#>   Bayesian (BIC)                              66147.66 
#>   Chi-square                                    124.54 
#>   Degrees of Freedom                               130 
#>   P-value (Chi-square)                           0.619 
#>   RMSEA                                          0.000 
#>   CFI                                            1.000 
#>   SRMR                                           0.024 
#> 
#> Fit Measures for Baseline Model (H0):
#>   Loglikelihood                              -32918.35 
#>   Akaike (AIC)                                65952.70 
#>   Bayesian (BIC)                              66277.56 
#>   Chi-square                                    262.04 
#>   Degrees of Freedom                               131 
#>   P-value (Chi-square)                           0.000 
#>   RMSEA                                          0.022 
#>   CFI                                            0.996 
#>   SRMR                                           0.046 
#> 
#> Comparative Fit to H0 (LRT test):
#>   Chi-square diff                              137.501 
#>   Degrees of freedom diff                            1 
#>   P-value (LRT)                                  0.000 
#> 
#> R-Squared Interaction Model (H1):
#>   INT                                            0.369 
#>   BEH                                            0.268 
#> R-Squared Baseline Model (H0):
#>   INT                                            0.369 
#>   BEH                                            0.211 
#> R-Squared Change (H1 - H0):
#>   INT                                           -0.000 
#>   BEH                                            0.057 
#> 
#> lavaan 0.6-19 ended normally after 273 iterations
#> 
#>   Estimator                                         ML
#>   Optimization method                           NLMINB
#>   Number of model parameters                        67
#>   Row rank of the constraints matrix                 8
#> 
#>   Number of observations                          2000
#> 
#> Model Test User Model:
#>                                                       
#>   Test statistic                               124.540
#>   Degrees of freedom                               130
#>   P-value (Chi-square)                           0.619
#> 
#> Parameter Estimates:
#> 
#>   Standard errors                             Standard
#>   Information                                 Expected
#>   Information saturated (h1) model          Structured
#> 
#> Latent Variables:
#>                    Estimate  Std.Err  z-value  P(>|z|)
#>   ATT =~                                              
#>     att1   (l_1_A)    1.000                           
#>     att2   (l_2_A)    0.878    0.012   71.494    0.000
#>     att3   (l_3_A)    0.789    0.012   66.355    0.000
#>     att4    (l_4_)    0.695    0.011   61.005    0.000
#>     att5    (l_5_)    0.887    0.013   70.871    0.000
#>   SN =~                                               
#>     sn1    (l_1_S)    1.000                           
#>     sn2    (l_2_S)    0.889    0.017   52.693    0.000
#>   PBC =~                                              
#>     pbc1   (l_1_P)    1.000                           
#>     pbc2   (l_2_P)    0.913    0.011   80.296    0.000
#>     pbc3   (l_3_P)    0.795    0.011   75.450    0.000
#>   INT =~                                              
#>     int1   (l_1_I)    1.000                           
#>     int2   (l_2_I)    0.913    0.013   71.295    0.000
#>     int3   (l_3_I)    0.797    0.012   66.791    0.000
#>   BEH =~                                              
#>     b1     (l_1_B)    1.000                           
#>     b2     (l_2_B)    0.962    0.031   30.667    0.000
#>   INTPBC =~                                           
#>     int1p1  (l_11)    1.000                           
#>     int2p2  (l_22)    0.833    0.012   66.642    0.000
#>     int3p3  (l_33)    0.634    0.010   62.661    0.000
#> 
#> Regressions:
#>                    Estimate  Std.Err  z-value  P(>|z|)
#>   INT ~                                               
#>     ATT     (G_AT)    0.214    0.026    8.193    0.000
#>     SN      (G_SN)    0.177    0.028    6.427    0.000
#>     PBC  (G_PBC_I)    0.220    0.029    7.615    0.000
#>   BEH ~                                               
#>     INT   (G_INT_)    0.189    0.024    7.810    0.000
#>     PBC  (G_PBC_B)    0.231    0.022   10.631    0.000
#>     INTP  (G_INTP)    0.209    0.018   11.587    0.000
#> 
#> Covariances:
#>                    Estimate  Std.Err  z-value  P(>|z|)
#>   ATT ~~                                              
#>     SN   (C_ATT_S)    0.630    0.026   24.699    0.000
#>     PBC  (C_ATT_P)    0.680    0.023   29.948    0.000
#>     INTP (C_ATT_I)    0.028    0.018    1.551    0.121
#>   SN ~~                                               
#>     PBC   (C_SN_P)    0.683    0.023   29.055    0.000
#>     INTP  (C_SN_I)   -0.004    0.019   -0.199    0.843
#>   PBC ~~                                              
#>     INTP    (C_PB)    0.000       NA                  
#>  .int1pbc1 ~~                                         
#>    .in22              0.000                           
#>    .in33              0.000                           
#>  .int2pbc2 ~~                                         
#>    .in33              0.000                           
#> 
#> Intercepts:
#>                    Estimate  Std.Err  z-value  P(>|z|)
#>     INTPBC  (M_IN)    0.480    0.014   33.491    0.000
#>    .att1              1.014    0.024   41.999    0.000
#>    .att2              1.007    0.021   46.960    0.000
#>    .att3              1.016    0.020   51.448    0.000
#>    .att4              0.999    0.018   55.647    0.000
#>    .att5              0.992    0.022   45.664    0.000
#>    .sn1               1.005    0.024   41.594    0.000
#>    .sn2               1.010    0.022   46.638    0.000
#>    .pbc1              0.997    0.024   42.323    0.000
#>    .pbc2              0.985    0.022   44.751    0.000
#>    .pbc3              0.991    0.020   50.566    0.000
#>    .int1              1.014    0.022   46.839    0.000
#>    .int2              1.012    0.020   50.167    0.000
#>    .int3              1.005    0.018   54.971    0.000
#>    .b1                0.997    0.022   45.295    0.000
#>    .b2                1.015    0.021   49.087    0.000
#>    .int1pb1          -0.014    0.029   -0.478    0.633
#>    .int2pb2           0.011    0.025    0.450    0.652
#>    .int3pb3          -0.005    0.020   -0.269    0.788
#> 
#> Variances:
#>                    Estimate  Std.Err  z-value  P(>|z|)
#>     ATT     (V_AT)    0.998    0.034   29.072    0.000
#>     SN      (V_SN)    0.990    0.037   26.938    0.000
#>     PBC     (V_PB)    0.970    0.026   37.161    0.000
#>    .INT     (Z_IN)    0.495    0.019   26.260    0.000
#>    .BEH     (Z_BE)    0.453    0.023   19.820    0.000
#>     INTPBC  (V_IN)    0.992    0.032   31.229    0.000
#>    .att1   (Vr_t1)    0.167    0.007   23.528    0.000
#>    .att2   (Vr_t2)    0.150    0.006   24.693    0.000
#>    .att3   (Vr_t3)    0.160    0.006   26.378    0.000
#>    .att4    (Vr_4)    0.163    0.006   27.649    0.000
#>    .att5    (Vr_5)    0.159    0.006   24.929    0.000
#>    .sn1    (Vr_s1)    0.178    0.015   12.118    0.000
#>    .sn2    (Vr_s2)    0.156    0.012   13.235    0.000
#>    .pbc1   (Vr_p1)    0.141    0.007   19.079    0.000
#>    .pbc2   (Vr_p2)    0.160    0.007   22.885    0.000
#>    .pbc3   (Vr_p3)    0.156    0.006   25.493    0.000
#>    .int1   (Vr_n1)    0.152    0.008   19.481    0.000
#>    .int2   (Vr_n2)    0.161    0.007   22.582    0.000
#>    .int3   (Vr_n3)    0.169    0.006   26.510    0.000
#>    .b1     (Vr_b1)    0.187    0.019    9.943    0.000
#>    .b2     (Vr_b2)    0.134    0.017    7.874    0.000
#>    .int1p1  (V_11)    0.279    0.010   29.251    0.000
#>    .int2p2  (V_22)    0.260    0.008   33.952    0.000
#>    .int3p3  (V_33)    0.208    0.005   37.854    0.000
#> 
#> Constraints:
#>                                                |Slack|
#>     V_INTPBC-((2*C_ATT_PBC*G_ATT_INT*G_PBC_IN    0.000
#>     Cov_PBC_INTPBC - 0                           0.000
#>     V_11-(_1_INT^2*(2*C_ATT_PBC*G_ATT_INT*G_P    0.000
#>     V_22-(_2_INT^2*(2*C_ATT_PBC*G_ATT_INT*G_P    0.000
#>     V_33-(_3_INT^2*(2*C_ATT_PBC*G_ATT_INT*G_P    0.000
#>     lmbd_nt1pbc1_INTPBC-(lmbd_nt1_INT*_1_PBC)    0.000
#>     lmbd_nt2pbc2_INTPBC-(lmbd_nt2_INT*_2_PBC)    0.000
#>     lmbd_nt3pbc3_INTPBC-(lmbd_nt3_INT*_3_PBC)    0.000
#>     M_INTPBC-((C_ATT_PBC*G_ATT_INT+C_SN_PBC*G    0.000
#> 

# LMS approach
est_tpb_lms <- modsem(tpb, data = TPB, method = "lms", nodes = 32)
summary(est_tpb_lms)
#> 
#> modsem (1.0.13) ended normally after 30 iterations
#> 
#>   Estimator                                        LMS
#>   Optimization method                       EMA-NLMINB
#>   Number of model parameters                        54
#>                                                       
#>   Number of observations                          2000
#>  
#> Loglikelihood and Information Criteria:
#>   Loglikelihood                              -26326.02
#>   Akaike (AIC)                                52760.04
#>   Bayesian (BIC)                              53062.49
#>  
#> Numerical Integration:
#>   Points of integration (per dim)                   32
#>   Dimensions                                         1
#>   Total points of integration                       32
#>  
#> Fit Measures for Baseline Model (H0):
#>                                               Standard
#>   Chi-square                                     66.27
#>   Degrees of Freedom (Chi-square)                   82
#>   P-value (Chi-square)                           0.897
#>   RMSEA                                          0.000
#>                                                       
#>   Loglikelihood                              -26393.22
#>   Akaike (AIC)                                52892.45
#>   Bayesian (BIC)                              53189.29
#>  
#> Comparative Fit to H0 (LRT test):
#>   Loglikelihood change                           67.20
#>   Difference test (D)                           134.40
#>   Degrees of freedom (D)                             1
#>   P-value (D)                                    0.000
#>  
#> R-Squared Interaction Model (H1):
#>   INT                                            0.366
#>   BEH                                            0.263
#> R-Squared Baseline Model (H0):
#>   INT                                            0.367
#>   BEH                                            0.210
#> R-Squared Change (H1 - H0):
#>   INT                                           -0.001
#>   BEH                                            0.053
#> 
#> Parameter Estimates:
#>   Coefficients                          unstandardized
#>   Information                                 observed
#>   Standard errors                             standard
#>  
#> Latent Variables:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>   ATT =~        
#>     att1            1.000                             
#>     att2            0.878      0.012   71.561    0.000
#>     att3            0.789      0.012   66.372    0.000
#>     att4            0.695      0.011   60.996    0.000
#>     att5            0.887      0.013   70.848    0.000
#>   SN =~         
#>     sn1             1.000                             
#>     sn2             0.888      0.017   52.601    0.000
#>   PBC =~        
#>     pbc1            1.000                             
#>     pbc2            0.912      0.013   69.346    0.000
#>     pbc3            0.801      0.012   65.997    0.000
#>   INT =~        
#>     int1            1.000                             
#>     int2            0.913      0.015   59.056    0.000
#>     int3            0.807      0.014   55.738    0.000
#>   BEH =~        
#>     b1              1.000                             
#>     b2              0.961      0.030   31.742    0.000
#> 
#> Regressions:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>   INT ~         
#>     ATT             0.213      0.026    8.164    0.000
#>     SN              0.176      0.028    6.387    0.000
#>     PBC             0.217      0.030    7.348    0.000
#>   BEH ~         
#>     PBC             0.232      0.022   10.402    0.000
#>     INT             0.189      0.025    7.683    0.000
#>     INT:PBC         0.205      0.018   11.311    0.000
#> 
#> Intercepts:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>    .pbc1            0.998      0.024   42.434    0.000
#>    .pbc2            0.985      0.022   44.954    0.000
#>    .pbc3            0.991      0.020   50.476    0.000
#>    .att1            1.014      0.024   42.022    0.000
#>    .att2            1.007      0.021   46.988    0.000
#>    .att3            1.017      0.020   51.476    0.000
#>    .att4            0.999      0.018   55.674    0.000
#>    .att5            0.992      0.022   45.692    0.000
#>    .sn1             1.006      0.024   41.674    0.000
#>    .sn2             1.011      0.022   46.729    0.000
#>    .int1            1.014      0.022   46.970    0.000
#>    .int2            1.012      0.020   50.412    0.000
#>    .int3            1.005      0.018   54.813    0.000
#>    .b1              1.001      0.021   46.997    0.000
#>    .b2              1.019      0.020   51.067    0.000
#> 
#> Covariances:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>   ATT ~~        
#>     SN              0.629      0.029   21.945    0.000
#>   PBC ~~        
#>     ATT             0.678      0.029   23.714    0.000
#>     SN              0.677      0.029   23.335    0.000
#> 
#> Variances:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>    .pbc1            0.144      0.008   18.392    0.000
#>    .pbc2            0.160      0.007   21.433    0.000
#>    .pbc3            0.155      0.006   23.890    0.000
#>    .att1            0.167      0.007   23.533    0.000
#>    .att2            0.150      0.006   24.718    0.000
#>    .att3            0.159      0.006   26.383    0.000
#>    .att4            0.162      0.006   27.648    0.000
#>    .att5            0.159      0.006   24.929    0.000
#>    .sn1             0.178      0.015   12.084    0.000
#>    .sn2             0.156      0.012   13.253    0.000
#>    .int1            0.157      0.009   18.108    0.000
#>    .int2            0.160      0.008   20.412    0.000
#>    .int3            0.168      0.007   23.553    0.000
#>    .b1              0.186      0.018   10.142    0.000
#>    .b2              0.135      0.017    8.113    0.000
#>     ATT             0.998      0.037   27.137    0.000
#>     SN              0.987      0.039   25.409    0.000
#>     PBC             0.962      0.035   27.243    0.000
#>    .INT             0.491      0.020   24.644    0.000
#>    .BEH             0.455      0.023   20.144    0.000
#> 

# QML approach
est_tpb_qml <- modsem(tpb, data = TPB, method = "qml")
summary(est_tpb_qml)
#> 
#> modsem (1.0.13) ended normally after 110 iterations
#> 
#>   Estimator                                        QML
#>   Optimization method                           NLMINB
#>   Number of model parameters                        54
#>                                                       
#>   Number of observations                          2000
#>  
#> Loglikelihood and Information Criteria:
#>   Loglikelihood                              -26326.05
#>   Akaike (AIC)                                52760.10
#>   Bayesian (BIC)                              53062.55
#>  
#> Fit Measures for Baseline Model (H0):
#>                                               Standard
#>   Chi-square                                     66.27
#>   Degrees of Freedom (Chi-square)                   82
#>   P-value (Chi-square)                           0.897
#>   RMSEA                                          0.000
#>                                                       
#>   Loglikelihood                              -26393.22
#>   Akaike (AIC)                                52892.45
#>   Bayesian (BIC)                              53189.29
#>  
#> Comparative Fit to H0 (LRT test):
#>   Loglikelihood change                           67.17
#>   Difference test (D)                           134.34
#>   Degrees of freedom (D)                             1
#>   P-value (D)                                    0.000
#>  
#> R-Squared Interaction Model (H1):
#>   INT                                            0.366
#>   BEH                                            0.263
#> R-Squared Baseline Model (H0):
#>   INT                                            0.367
#>   BEH                                            0.210
#> R-Squared Change (H1 - H0):
#>   INT                                            0.000
#>   BEH                                            0.053
#> 
#> Parameter Estimates:
#>   Coefficients                          unstandardized
#>   Information                                 observed
#>   Standard errors                             standard
#>  
#> Latent Variables:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>   ATT =~        
#>     att1            1.000                             
#>     att2            0.878      0.012   71.565    0.000
#>     att3            0.789      0.012   66.376    0.000
#>     att4            0.695      0.011   61.001    0.000
#>     att5            0.887      0.013   70.852    0.000
#>   SN =~         
#>     sn1             1.000                             
#>     sn2             0.888      0.017   52.606    0.000
#>   PBC =~        
#>     pbc1            1.000                             
#>     pbc2            0.912      0.013   69.465    0.000
#>     pbc3            0.801      0.012   66.094    0.000
#>   INT =~        
#>     int1            1.000                             
#>     int2            0.913      0.015   59.048    0.000
#>     int3            0.807      0.014   55.731    0.000
#>   BEH =~        
#>     b1              1.000                             
#>     b2              0.960      0.030   31.749    0.000
#> 
#> Regressions:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>   INT ~         
#>     ATT             0.213      0.026    8.165    0.000
#>     SN              0.176      0.028    6.387    0.000
#>     PBC             0.217      0.030    7.349    0.000
#>   BEH ~         
#>     PBC             0.232      0.022   10.406    0.000
#>     INT             0.189      0.025    7.678    0.000
#>     INT:PBC         0.205      0.018   11.309    0.000
#> 
#> Intercepts:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>    .int1            1.014      0.022   46.956    0.000
#>    .int2            1.012      0.020   50.399    0.000
#>    .int3            1.005      0.018   54.798    0.000
#>    .att1            1.014      0.024   42.002    0.000
#>    .att2            1.007      0.021   46.963    0.000
#>    .att3            1.016      0.020   51.451    0.000
#>    .att4            0.999      0.018   55.652    0.000
#>    .att5            0.992      0.022   45.666    0.000
#>    .sn1             1.005      0.024   41.658    0.000
#>    .sn2             1.010      0.022   46.705    0.000
#>    .pbc1            0.998      0.024   42.410    0.000
#>    .pbc2            0.985      0.022   44.929    0.000
#>    .pbc3            0.991      0.020   50.449    0.000
#>    .b1              1.001      0.021   46.993    0.000
#>    .b2              1.019      0.020   51.070    0.000
#> 
#> Covariances:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>   ATT ~~        
#>     SN              0.629      0.029   21.703    0.000
#>     PBC             0.678      0.029   23.457    0.000
#>   SN ~~         
#>     PBC             0.677      0.029   23.083    0.000
#> 
#> Variances:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>    .int1            0.157      0.009   18.106    0.000
#>    .int2            0.160      0.008   20.407    0.000
#>    .int3            0.168      0.007   23.549    0.000
#>    .att1            0.167      0.007   23.533    0.000
#>    .att2            0.150      0.006   24.716    0.000
#>    .att3            0.159      0.006   26.381    0.000
#>    .att4            0.162      0.006   27.649    0.000
#>    .att5            0.159      0.006   24.926    0.000
#>    .sn1             0.178      0.015   12.093    0.000
#>    .sn2             0.157      0.012   13.251    0.000
#>    .pbc1            0.144      0.008   18.390    0.000
#>    .pbc2            0.160      0.007   21.430    0.000
#>    .pbc3            0.155      0.006   23.885    0.000
#>    .b1              0.186      0.018   10.125    0.000
#>    .b2              0.135      0.017    8.130    0.000
#>     ATT             0.998      0.037   26.943    0.000
#>     SN              0.987      0.039   25.230    0.000
#>     PBC             0.962      0.036   27.074    0.000
#>    .INT             0.491      0.020   24.642    0.000
#>    .BEH             0.455      0.023   20.139    0.000
#> 
# }