non-centered interaction terms (LMS and QML)
meanstructure_lms_qml.RmdNon-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)
#> 
#> modsem (1.0.14) ended normally after 86 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
#>  
#> 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.262
#> R-Squared Baseline Model (H0):
#>   INT                                            0.367
#>   BEH                                            0.210
#> R-Squared Change (H1 - H0):
#>   INT                                           -0.001
#>   BEH                                            0.052
#> 
#> 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.635    0.000
#>     att3            0.789      0.012   66.429    0.000
#>     att4            0.695      0.011   61.040    0.000
#>     att5            0.887      0.013   70.920    0.000
#>   SN =~         
#>     sn1             1.000                             
#>     sn2             0.888      0.017   52.697    0.000
#>   PBC =~        
#>     pbc1            1.000                             
#>     pbc2            0.912      0.013   69.394    0.000
#>     pbc3            0.801      0.012   66.023    0.000
#>   INT =~        
#>     int1            1.000                             
#>     int2            0.913      0.015   59.154    0.000
#>     int3            0.807      0.014   55.811    0.000
#>   BEH =~        
#>     b1              1.000                             
#>     b2              0.960      0.030   32.031    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.388    0.000
#>     PBC             0.217      0.030    7.348    0.000
#>   BEH ~         
#>     PBC             0.025      0.029    0.859    0.390
#>     INT            -0.015      0.030   -0.511    0.610
#>     INT:PBC         0.205      0.018   11.323    0.000
#> 
#> Intercepts:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>    .pbc2            0.075      0.018    4.230    0.000
#>    .pbc3            0.192      0.016   11.717    0.000
#>    .att2            0.117      0.017    6.817    0.000
#>    .att3            0.217      0.017   13.027    0.000
#>    .att4            0.294      0.016   18.446    0.000
#>    .att5            0.093      0.017    5.308    0.000
#>    .sn2             0.117      0.021    5.605    0.000
#>    .int2            0.087      0.020    4.384    0.000
#>    .int3            0.187      0.019    9.996    0.000
#>    .b2              0.058      0.035    1.646    0.100
#>     ATT             1.014      0.024   42.006    0.000
#>     SN              1.005      0.024   41.655    0.000
#>     PBC             0.997      0.024   42.405    0.000
#>    .INT             0.403      0.027   14.692    0.000
#>    .BEH             0.785      0.030   26.219    0.000
#> 
#> Covariances:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>   ATT ~~        
#>     SN              0.629      0.029   21.949    0.000
#>   PBC ~~        
#>     ATT             0.677      0.029   23.718    0.000
#>     SN              0.677      0.029   23.338    0.000
#> 
#> Variances:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>    .pbc1            0.144      0.008   18.402    0.000
#>    .pbc2            0.160      0.007   21.450    0.000
#>    .pbc3            0.155      0.006   23.901    0.000
#>    .att1            0.167      0.007   23.537    0.000
#>    .att2            0.150      0.006   24.723    0.000
#>    .att3            0.159      0.006   26.389    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.096    0.000
#>    .sn2             0.157      0.012   13.269    0.000
#>    .int1            0.157      0.009   18.111    0.000
#>    .int2            0.160      0.008   20.423    0.000
#>    .int3            0.168      0.007   23.560    0.000
#>    .b1              0.186      0.018   10.173    0.000
#>    .b2              0.135      0.016    8.195    0.000
#>     ATT             0.998      0.037   27.148    0.000
#>     SN              0.987      0.039   25.418    0.000
#>     PBC             0.961      0.035   27.249    0.000
#>    .INT             0.491      0.020   24.656    0.000
#>    .BEH             0.455      0.023   20.213    0.000Comparing 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, centered = TRUE)
#> 
#> modsem (1.0.14) ended normally after 86 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
#>  
#> 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.262
#> R-Squared Baseline Model (H0):
#>   INT                                            0.367
#>   BEH                                            0.210
#> R-Squared Change (H1 - H0):
#>   INT                                           -0.001
#>   BEH                                            0.052
#> 
#> Parameter Estimates:
#>   Coefficients                            standardized
#>   Information                                 observed
#>   Standard errors                             standard
#>  
#> Latent Variables:
#>                  Estimate  Std.Error  z.value  P(>|z|)  Std.all  Cnt.all
#>   ATT =~        
#>     att1            1.000                                 0.925    1.000
#>     att2            0.878      0.012   71.635    0.000    0.915    0.878
#>     att3            0.789      0.012   66.429    0.000    0.892    0.789
#>     att4            0.695      0.011   61.040    0.000    0.865    0.695
#>     att5            0.887      0.013   70.920    0.000    0.912    0.887
#>   SN =~         
#>     sn1             1.000                                 0.920    1.000
#>     sn2             0.888      0.017   52.697    0.000    0.912    0.888
#>   PBC =~        
#>     pbc1            1.000                                 0.933    1.000
#>     pbc2            0.912      0.013   69.394    0.000    0.913    0.912
#>     pbc3            0.801      0.012   66.023    0.000    0.894    0.801
#>   INT =~        
#>     int1            1.000                                 0.912    1.000
#>     int2            0.913      0.015   59.154    0.000    0.895    0.913
#>     int3            0.807      0.014   55.811    0.000    0.866    0.807
#>   BEH =~        
#>     b1              1.000                                 0.877    1.000
#>     b2              0.960      0.030   32.031    0.000    0.899    0.960
#> 
#> Regressions:
#>                  Estimate  Std.Error  z.value  P(>|z|)  Std.all  Cnt.all
#>   INT ~         
#>     ATT             0.213      0.026    8.165    0.000    0.242    0.213
#>     SN              0.176      0.028    6.388    0.000    0.199    0.176
#>     PBC             0.217      0.030    7.348    0.000    0.242    0.217
#>   BEH ~         
#>     PBC             0.025      0.029    0.859    0.390    0.290    0.232
#>     INT            -0.015      0.030   -0.511    0.610    0.212    0.189
#>     INT:PBC         0.205      0.018   11.323    0.000    0.225    0.205
#> 
#> Intercepts:
#>                  Estimate  Std.Error  z.value  P(>|z|)  Std.all  Cnt.all
#>    .pbc2            0.075      0.018    4.230    0.000                  
#>    .pbc3            0.192      0.016   11.717    0.000                  
#>    .att2            0.117      0.017    6.817    0.000                  
#>    .att3            0.217      0.017   13.027    0.000                  
#>    .att4            0.294      0.016   18.446    0.000                  
#>    .att5            0.093      0.017    5.308    0.000                  
#>    .sn2             0.117      0.021    5.605    0.000                  
#>    .int2            0.087      0.020    4.384    0.000                  
#>    .int3            0.187      0.019    9.996    0.000                  
#>    .b2              0.058      0.035    1.646    0.100                  
#>     ATT             1.014      0.024   42.006    0.000                  
#>     SN              1.005      0.024   41.655    0.000                  
#>     PBC             0.997      0.024   42.405    0.000                  
#>    .INT             0.403      0.027   14.692    0.000                  
#>    .BEH             0.785      0.030   26.219    0.000                  
#> 
#> Covariances:
#>                  Estimate  Std.Error  z.value  P(>|z|)  Std.all  Cnt.all
#>   ATT ~~        
#>     SN              0.629      0.029   21.949    0.000    0.634    0.629
#>   PBC ~~        
#>     ATT             0.677      0.029   23.718    0.000    0.692    0.677
#>     SN              0.677      0.029   23.338    0.000    0.695    0.677
#> 
#> Variances:
#>                  Estimate  Std.Error  z.value  P(>|z|)  Std.all  Cnt.all
#>    .pbc1            0.144      0.008   18.402    0.000    0.130    0.144
#>    .pbc2            0.160      0.007   21.450    0.000    0.166    0.160
#>    .pbc3            0.155      0.006   23.901    0.000    0.201    0.155
#>    .att1            0.167      0.007   23.537    0.000    0.144    0.167
#>    .att2            0.150      0.006   24.723    0.000    0.164    0.150
#>    .att3            0.159      0.006   26.389    0.000    0.204    0.159
#>    .att4            0.162      0.006   27.655    0.000    0.252    0.162
#>    .att5            0.159      0.006   24.936    0.000    0.168    0.159
#>    .sn1             0.178      0.015   12.096    0.000    0.153    0.178
#>    .sn2             0.157      0.012   13.269    0.000    0.167    0.157
#>    .int1            0.157      0.009   18.111    0.000    0.168    0.157
#>    .int2            0.160      0.008   20.423    0.000    0.199    0.160
#>    .int3            0.168      0.007   23.560    0.000    0.249    0.168
#>    .b1              0.186      0.018   10.173    0.000    0.231    0.186
#>    .b2              0.135      0.016    8.195    0.000    0.192    0.135
#>     ATT             0.998      0.037   27.148    0.000    1.000    0.998
#>     SN              0.987      0.039   25.418    0.000    1.000    0.987
#>     PBC             0.961      0.035   27.249    0.000    1.000    0.961
#>    .INT             0.491      0.020   24.656    0.000    0.634    0.491
#>    .BEH             0.455      0.023   20.213    0.000    0.738    0.455It is also possible to get the centered solution using the
centered_estimates() function. Note, that
centered_estimates() removes the mean structure of the
model all together.
centered_estimates(est)
#>        lhs op     rhs label group   est std.error z.value p.value ci.lower
#> 1      ATT =~    att1           1 1.000        NA      NA      NA       NA
#> 2      ATT =~    att2           1 0.878     0.012  71.635       0    0.854
#> 3      ATT =~    att3           1 0.789     0.012  66.429       0    0.765
#> 4      ATT =~    att4           1 0.695     0.011  61.040       0    0.672
#> 5      ATT =~    att5           1 0.887     0.013  70.920       0    0.862
#> 6       SN =~     sn1           1 1.000        NA      NA      NA       NA
#> 7       SN =~     sn2           1 0.888     0.017  52.697       0    0.855
#> 8      PBC =~    pbc1           1 1.000        NA      NA      NA       NA
#> 9      PBC =~    pbc2           1 0.912     0.013  69.394       0    0.886
#> 10     PBC =~    pbc3           1 0.801     0.012  66.023       0    0.777
#> 11     INT =~    int1           1 1.000        NA      NA      NA       NA
#> 12     INT =~    int2           1 0.913     0.015  59.154       0    0.883
#> 13     INT =~    int3           1 0.807     0.014  55.811       0    0.779
#> 14     BEH =~      b1           1 1.000        NA      NA      NA       NA
#> 15     BEH =~      b2           1 0.960     0.030  32.031       0    0.901
#> 16     INT  ~     ATT           1 0.213     0.026   8.165       0    0.162
#> 17     INT  ~      SN           1 0.176     0.028   6.388       0    0.122
#> 18     INT  ~     PBC           1 0.217     0.030   7.348       0    0.159
#> 19     BEH  ~     PBC           1 0.232     0.022  10.404       0    0.189
#> 20     BEH  ~     INT           1 0.189     0.025   7.667       0    0.141
#> 21     BEH  ~ INT:PBC           1 0.205     0.018  11.323       0    0.169
#> 22    pbc1 ~~    pbc1           1 0.144     0.008  18.402       0    0.129
#> 23    pbc2 ~~    pbc2           1 0.160     0.007  21.450       0    0.145
#> 24    pbc3 ~~    pbc3           1 0.155     0.006  23.901       0    0.142
#> 25    att1 ~~    att1           1 0.167     0.007  23.537       0    0.153
#> 26    att2 ~~    att2           1 0.150     0.006  24.723       0    0.138
#> 27    att3 ~~    att3           1 0.159     0.006  26.389       0    0.148
#> 28    att4 ~~    att4           1 0.162     0.006  27.655       0    0.151
#> 29    att5 ~~    att5           1 0.159     0.006  24.936       0    0.146
#> 30     sn1 ~~     sn1           1 0.178     0.015  12.096       0    0.149
#> 31     sn2 ~~     sn2           1 0.157     0.012  13.269       0    0.133
#> 32    int1 ~~    int1           1 0.157     0.009  18.111       0    0.140
#> 33    int2 ~~    int2           1 0.160     0.008  20.423       0    0.145
#> 34    int3 ~~    int3           1 0.168     0.007  23.560       0    0.154
#> 35      b1 ~~      b1           1 0.186     0.018  10.173       0    0.150
#> 36      b2 ~~      b2           1 0.135     0.016   8.195       0    0.103
#> 37     ATT ~~     ATT           1 0.998     0.037  27.148       0    0.926
#> 38     ATT ~~      SN           1 0.629     0.029  21.949       0    0.573
#> 39      SN ~~      SN           1 0.987     0.039  25.418       0    0.911
#> 40     PBC ~~     ATT           1 0.677     0.029  23.718       0    0.621
#> 41     PBC ~~      SN           1 0.677     0.029  23.338       0    0.620
#> 42     PBC ~~     PBC           1 0.961     0.035  27.249       0    0.892
#> 43     PBC ~~ INT:PBC           1 0.000        NA      NA      NA       NA
#> 44     INT ~~     INT           1 0.491     0.020  24.656       0    0.452
#> 45     INT ~~ INT:PBC           1 0.000        NA      NA      NA       NA
#> 46     BEH ~~     BEH           1 0.455     0.023  20.213       0    0.411
#> 47 INT:PBC ~~ INT:PBC           1 0.969        NA      NA      NA       NA
#>    ci.upper
#> 1        NA
#> 2     0.902
#> 3     0.812
#> 4     0.717
#> 5     0.911
#> 6        NA
#> 7     0.921
#> 8        NA
#> 9     0.938
#> 10    0.824
#> 11       NA
#> 12    0.943
#> 13    0.835
#> 14       NA
#> 15    1.019
#> 16    0.265
#> 17    0.231
#> 18    0.275
#> 19    0.276
#> 20    0.238
#> 21    0.240
#> 22    0.160
#> 23    0.174
#> 24    0.168
#> 25    0.181
#> 26    0.162
#> 27    0.171
#> 28    0.174
#> 29    0.171
#> 30    0.207
#> 31    0.180
#> 32    0.174
#> 33    0.176
#> 34    0.182
#> 35    0.222
#> 36    0.167
#> 37    1.070
#> 38    0.685
#> 39    1.063
#> 40    0.733
#> 41    0.734
#> 42    1.031
#> 43       NA
#> 44    0.530
#> 45       NA
#> 46    0.499
#> 47       NA