Skip to contents
library(modsem)
#> This is modsem (1.0.11). Please report any bugs!

Non-centered interaction terms

Using the LMS and QML approaches it is possible to estimate interaction terms where the means of the latent variables are not centered (i.e., they have non-zero means).

Here we can see an example using the TPB dataset:

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

# Adding Latent Intercepts
  INT ~ 1
  BEH ~ 1
  PBC ~ 1
  SN  ~ 1
  ATT ~ 1
'

est <- modsem(tpb, TPB, method = "lms", nodes = 32)
summary(est)
#> Estimating baseline model (H0)
#> 
#> modsem (version 1.0.11):
#> 
#>   Estimator                                         LMS
#>   Optimization method                        EMA-NLMINB
#>   Number of observations                           2000
#>   Number of iterations                               36
#>   Loglikelihood                               -23439.04
#>   Akaike (AIC)                                 46986.09
#>   Bayesian (BIC)                               47288.54
#>  
#> Numerical Integration:
#>   Points of integration (per dim)                    32
#>   Dimensions                                          1
#>   Total points of integration                        32
#>  
#> Fit Measures for Baseline Model (H0):
#>   Loglikelihood                                  -26393
#>   Akaike (AIC)                                 52892.45
#>   Bayesian (BIC)                               53189.29
#>   Chi-square                                    2625.24
#>   Degrees of Freedom (Chi-square)                    79
#>   P-value (Chi-square)                            0.000
#>   RMSEA                                           0.127
#>  
#> Comparative Fit to H0 (LRT test):
#>   Loglikelihood change                          2954.18
#>   Difference test (D)                           5908.36
#>   Degrees of freedom (D)                              1
#>   P-value (D)                                     0.000
#>  
#> R-Squared Interaction Model (H1):
#>   INT                                             0.364
#>   BEH                                             0.259
#> R-Squared Baseline Model (H0):
#>   INT                                             0.367
#>   BEH                                             0.210
#> R-Squared Change (H1 - H0):
#>   INT                                            -0.003
#>   BEH                                             0.048
#> 
#> Parameter Estimates:
#>   Coefficients                           unstandardized
#>   Information                                  observed
#>   Standard errors                              standard
#>  
#> Latent Variables:
#>                   Estimate  Std.Error  z.value  P(>|z|)
#>   PBC =~ 
#>     pbc1             1.000                             
#>     pbc2             0.914      0.013   69.485    0.000
#>     pbc3             0.802      0.012   66.040    0.000
#>   ATT =~ 
#>     att1             1.000                             
#>     att2             0.878      0.012   71.637    0.000
#>     att3             0.789      0.012   66.436    0.000
#>     att4             0.695      0.011   61.044    0.000
#>     att5             0.887      0.013   70.923    0.000
#>   SN =~ 
#>     sn1              1.000                             
#>     sn2              0.889      0.017   52.718    0.000
#>   INT =~ 
#>     int1             1.000                             
#>     int2             0.913      0.015   59.154    0.000
#>     int3             0.807      0.014   55.810    0.000
#>   BEH =~ 
#>     b1               1.000                             
#>     b2               0.959      0.030   32.035    0.000
#> 
#> Regressions:
#>                   Estimate  Std.Error  z.value  P(>|z|)
#>   INT ~ 
#>     PBC              0.218      0.030    7.335    0.000
#>     ATT              0.214      0.026    8.175    0.000
#>     SN               0.176      0.028    6.384    0.000
#>   BEH ~ 
#>     PBC              0.026      0.029    0.889    0.374
#>     INT             -0.015      0.030   -0.511    0.609
#>     PBC:INT          0.205      0.018   11.308    0.000
#> 
#> Intercepts:
#>                   Estimate  Std.Error  z.value  P(>|z|)
#>     pbc2             0.072      0.018    4.094    0.000
#>     pbc3             0.191      0.016   11.582    0.000
#>     att2             0.117      0.017    6.828    0.000
#>     att3             0.217      0.017   13.036    0.000
#>     att4             0.294      0.016   18.457    0.000
#>     att5             0.093      0.017    5.318    0.000
#>     sn2              0.117      0.021    5.596    0.000
#>     int2             0.087      0.020    4.383    0.000
#>     int3             0.187      0.019    9.995    0.000
#>     b2               0.059      0.035    1.678    0.093
#>     INT              0.403      0.027   14.675    0.000
#>     BEH              0.784      0.030   26.169    0.000
#>     PBC              0.988      0.024   41.100    0.000
#>     ATT              1.007      0.024   41.288    0.000
#>     SN               0.999      0.024   40.944    0.000
#> 
#> Covariances:
#>                   Estimate  Std.Error  z.value  P(>|z|)
#>   PBC ~~ 
#>     ATT              0.669      0.029   23.433    0.000
#>     SN               0.669      0.029   23.109    0.000
#>   ATT ~~ 
#>     SN               0.624      0.029   21.797    0.000
#> 
#> Variances:
#>                   Estimate  Std.Error  z.value  P(>|z|)
#>     pbc1             0.148      0.008   19.186    0.000
#>     pbc2             0.159      0.007   21.257    0.000
#>     pbc3             0.155      0.006   23.848    0.000
#>     att1             0.167      0.007   23.535    0.000
#>     att2             0.150      0.006   24.724    0.000
#>     att3             0.159      0.006   26.387    0.000
#>     att4             0.162      0.006   27.655    0.000
#>     att5             0.159      0.006   24.936    0.000
#>     sn1              0.178      0.015   12.126    0.000
#>     sn2              0.156      0.012   13.252    0.000
#>     int1             0.157      0.009   18.112    0.000
#>     int2             0.160      0.008   20.423    0.000
#>     int3             0.168      0.007   23.559    0.000
#>     b1               0.185      0.018   10.132    0.000
#>     b2               0.136      0.016    8.243    0.000
#>     PBC              0.949      0.035   27.057    0.000
#>     ATT              0.993      0.037   27.081    0.000
#>     SN               0.982      0.039   25.364    0.000
#>     INT              0.491      0.020   24.653    0.000
#>     BEH              0.456      0.023   20.212    0.000

Comparing this to the estimates we get when PBC and INT have zero means, we see that the coefficients BEH~PBC and BEH~INT are drastically changed. This is not a bug, and is a function of the interaction effect rescaling the coefficients, when not centered at zero. When using the standardized_estimates function, or summary(est, standardized = TRUE) the interaction effect is centered, and we can see that the coefficients BEH~PBC and BEH~INT are rescaled once again.

summary(est, standardized = TRUE)
#> Estimating baseline model (H0)
#> 
#> modsem (version 1.0.11):
#> 
#>   Estimator                                         LMS
#>   Optimization method                        EMA-NLMINB
#>   Number of observations                           2000
#>   Number of iterations                               36
#>   Loglikelihood                               -23439.04
#>   Akaike (AIC)                                 46986.09
#>   Bayesian (BIC)                               47288.54
#>  
#> Numerical Integration:
#>   Points of integration (per dim)                    32
#>   Dimensions                                          1
#>   Total points of integration                        32
#>  
#> Fit Measures for Baseline Model (H0):
#>   Loglikelihood                                  -26393
#>   Akaike (AIC)                                 52892.45
#>   Bayesian (BIC)                               53189.29
#>   Chi-square                                    2625.24
#>   Degrees of Freedom (Chi-square)                    79
#>   P-value (Chi-square)                            0.000
#>   RMSEA                                           0.127
#>  
#> Comparative Fit to H0 (LRT test):
#>   Loglikelihood change                          2954.18
#>   Difference test (D)                           5908.36
#>   Degrees of freedom (D)                              1
#>   P-value (D)                                     0.000
#>  
#> R-Squared Interaction Model (H1):
#>   INT                                             0.364
#>   BEH                                             0.259
#> R-Squared Baseline Model (H0):
#>   INT                                             0.367
#>   BEH                                             0.210
#> R-Squared Change (H1 - H0):
#>   INT                                            -0.003
#>   BEH                                             0.048
#> 
#> Parameter Estimates:
#>   Coefficients                             standardized
#>   Information                                  observed
#>   Standard errors                              standard
#>  
#> Latent Variables:
#>                   Estimate  Std.Error  z.value  P(>|z|)
#>   PBC =~ 
#>     pbc1             0.930      0.004   224.45    0.000
#>     pbc2             0.913      0.005   188.33    0.000
#>     pbc3             0.893      0.006   160.22    0.000
#>   ATT =~ 
#>     att1             0.925      0.004   231.88    0.000
#>     att2             0.914      0.004   212.56    0.000
#>     att3             0.892      0.005   173.38    0.000
#>     att4             0.864      0.006   139.00    0.000
#>     att5             0.912      0.004   208.13    0.000
#>   SN =~ 
#>     sn1              0.920      0.007   127.42    0.000
#>     sn2              0.912      0.007   124.84    0.000
#>   INT =~ 
#>     int1             0.912      0.006   162.08    0.000
#>     int2             0.895      0.006   147.20    0.000
#>     int3             0.866      0.007   125.35    0.000
#>   BEH =~ 
#>     b1               0.877      0.013    68.44    0.000
#>     b2               0.898      0.014    64.50    0.000
#> 
#> Regressions:
#>                   Estimate  Std.Error  z.value  P(>|z|)
#>   INT ~ 
#>     PBC              0.241      0.032     7.42    0.000
#>     ATT              0.242      0.029     8.32    0.000
#>     SN               0.199      0.031     6.48    0.000
#>   BEH ~ 
#>     PBC              0.289      0.033     8.65    0.000
#>     INT              0.210      0.032     6.54    0.000
#>     PBC:INT          0.224      0.022     9.97    0.000
#> 
#> Covariances:
#>                   Estimate  Std.Error  z.value  P(>|z|)
#>   PBC ~~ 
#>     ATT              0.690      0.013    52.87    0.000
#>     SN               0.693      0.014    50.95    0.000
#>   ATT ~~ 
#>     SN               0.632      0.015    42.07    0.000
#> 
#> Variances:
#>                   Estimate  Std.Error  z.value  P(>|z|)
#>     pbc1             0.135      0.008    17.52    0.000
#>     pbc2             0.167      0.009    18.71    0.000
#>     pbc3             0.202      0.010    20.28    0.000
#>     att1             0.144      0.007    19.83    0.000
#>     att2             0.164      0.008    20.70    0.000
#>     att3             0.205      0.009    22.14    0.000
#>     att4             0.253      0.011    23.61    0.000
#>     att5             0.169      0.008    21.01    0.000
#>     sn1              0.154      0.013    11.56    0.000
#>     sn2              0.168      0.013    12.52    0.000
#>     int1             0.169      0.010    16.39    0.000
#>     int2             0.199      0.011    18.10    0.000
#>     int3             0.250      0.012    20.86    0.000
#>     b1               0.231      0.022    10.30    0.000
#>     b2               0.194      0.025     7.67    0.000
#>     PBC              1.000                             
#>     ATT              1.000                             
#>     SN               1.000                             
#>     INT              0.636      0.019    34.09    0.000
#>     BEH              0.741      0.024    31.04    0.000