This vignette shows how to estimate interaction models, with both continuous and ordered (categorical) data.

Model Syntax

m <- '
  X =~ x1 + x2 + x3
  Z =~ z1 + z2 + z3
  Y =~ y1 + y2 + y3

  Y ~ X + Z + X:Z
'

Continuous Indicators

fit_cont <- pls(
  m,
  data      = modsem::oneInt,
  bootstrap = TRUE,
  sample    = 500
)
summary(fit_cont)
#> plssem (0.1.0) ended normally after 3 iterations
#> 
#>   Estimator                                       PLSc
#>   Link                                          LINEAR
#>                                                       
#>   Number of observations                          2000
#>   Number of iterations                               3
#>   Number of latent variables                         3
#>   Number of observed variables                       9
#> 
#> R-squared (indicators):
#>   x1                                             0.863
#>   x2                                             0.819
#>   x3                                             0.809
#>   z1                                             0.830
#>   z2                                             0.827
#>   z3                                             0.843
#>   y1                                             0.934
#>   y2                                             0.919
#>   y3                                             0.923
#> 
#> R-squared (latents):
#>   Y                                              0.604
#> 
#> Latent Variables:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>   X =~          
#>     x1              0.929      0.013   72.389    0.000
#>     x2              0.905      0.014   64.833    0.000
#>     x3              0.899      0.014   63.814    0.000
#>   Z =~          
#>     z1              0.911      0.014   63.683    0.000
#>     z2              0.909      0.016   58.088    0.000
#>     z3              0.918      0.015   60.891    0.000
#>   Y =~          
#>     y1              0.966      0.006  157.741    0.000
#>     y2              0.959      0.007  136.924    0.000
#>     y3              0.961      0.007  135.412    0.000
#> 
#> Regressions:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>   Y ~           
#>     X               0.423      0.018   24.040    0.000
#>     Z               0.361      0.018   19.869    0.000
#>     X:Z             0.452      0.017   26.402    0.000
#> 
#> Covariances:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>   X ~~          
#>     Z               0.201      0.023    8.852    0.000
#>     X:Z             0.018      0.030    0.595    0.552
#>   Z ~~          
#>     X:Z             0.060      0.037    1.617    0.106
#> 
#> Variances:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>     X               1.000                             
#>     Z               1.000                             
#>    .Y               0.396      0.020   19.935    0.000
#>     X:Z             1.013      0.048   21.041    0.000
#>    .x1              0.137      0.024    5.765    0.000
#>    .x2              0.181      0.025    7.153    0.000
#>    .x3              0.191      0.025    7.540    0.000
#>    .z1              0.170      0.026    6.550    0.000
#>    .z2              0.173      0.028    6.078    0.000
#>    .z3              0.157      0.028    5.680    0.000
#>    .y1              0.066      0.012    5.589    0.000
#>    .y2              0.081      0.013    6.044    0.000
#>    .y3              0.077      0.014    5.677    0.000

Ordered Indicators

fit_ord <- pls(
  m,
  data      = oneIntOrdered,
  bootstrap = TRUE,
  sample    = 500,
  ordered   = colnames(oneIntOrdered) # explicitly specify variables as ordered
)
summary(fit_ord)
#> plssem (0.1.0) ended normally after 18 iterations
#> 
#>   Estimator                                    OrdPLSc
#>   Link                                     PROBIT-CEXP
#>                                                       
#>   Number of observations                          2000
#>   Number of iterations                              18
#>   Number of latent variables                         3
#>   Number of observed variables                       9
#> 
#> R-squared (indicators):
#>   x1                                             0.810
#>   x2                                             0.753
#>   x3                                             0.729
#>   z1                                             0.798
#>   z2                                             0.755
#>   z3                                             0.750
#>   y1                                             0.848
#>   y2                                             0.838
#>   y3                                             0.848
#> 
#> R-squared (latents):
#>   Y                                              0.592
#> 
#> Latent Variables:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>   X =~          
#>     x1              0.900      0.016   54.759    0.000
#>     x2              0.867      0.017   49.969    0.000
#>     x3              0.854      0.019   46.088    0.000
#>   Z =~          
#>     z1              0.894      0.019   47.522    0.000
#>     z2              0.869      0.019   45.544    0.000
#>     z3              0.866      0.019   46.386    0.000
#>   Y =~          
#>     y1              0.921      0.011   82.269    0.000
#>     y2              0.916      0.013   70.685    0.000
#>     y3              0.921      0.011   83.027    0.000
#> 
#> Regressions:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>   Y ~           
#>     X               0.419      0.019   21.548    0.000
#>     Z               0.354      0.020   18.024    0.000
#>     X:Z             0.448      0.020   22.873    0.000
#> 
#> Covariances:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>   X ~~          
#>     Z               0.195      0.024    8.270    0.000
#>     X:Z             0.016      0.032    0.515    0.607
#>   Z ~~          
#>     X:Z             0.070      0.036    1.961    0.050
#> 
#> Thresholds:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>     x1|t1          -2.183      0.077  -28.536    0.000
#>     x1|t2          -0.827      0.032  -25.698    0.000
#>     x1|t3           0.077      0.028    2.758    0.006
#>     x1|t4           0.895      0.032   28.141    0.000
#>     x1|t5           1.859      0.061   30.509    0.000
#>     x2|t1          -2.576      0.123  -20.951    0.000
#>     x2|t2          -1.594      0.046  -34.934    0.000
#>     x2|t3          -0.425      0.029  -14.407    0.000
#>     x2|t4           0.418      0.028   14.718    0.000
#>     x2|t5           1.302      0.036   35.702    0.000
#>     x2|t6           2.484      0.108   23.104    0.000
#>     x3|t1          -2.387      0.092  -25.850    0.000
#>     x3|t2          -1.248      0.037  -33.302    0.000
#>     x3|t3          -0.083      0.027   -3.056    0.002
#>     x3|t4           0.749      0.030   24.888    0.000
#>     x3|t5           2.086      0.066   31.433    0.000
#>     x3|t6           2.697      0.130   20.700    0.000
#>     z1|t1          -2.024      0.063  -31.871    0.000
#>     z1|t2          -0.782      0.032  -24.813    0.000
#>     z1|t3           0.285      0.027   10.482    0.000
#>     z1|t4           0.938      0.034   27.525    0.000
#>     z1|t5           2.273      0.081   28.226    0.000
#>     z1|t6           3.291      2.958    1.112    0.266
#>     z2|t1          -2.878      0.664   -4.334    0.000
#>     z2|t2          -1.594      0.422   -3.779    0.000
#>     z2|t3          -0.749      0.494   -1.516    0.130
#>     z2|t4           0.242      0.487    0.497    0.619
#>     z2|t5           1.213      0.598    2.030    0.042
#>     z2|t6           2.308      2.477    0.932    0.351
#>     z3|t1          -3.291      0.737   -4.462    0.000
#>     z3|t2          -1.960      0.601   -3.260    0.001
#>     z3|t3          -1.273      0.787   -1.618    0.106
#>     z3|t4          -0.204      0.727   -0.281    0.779
#>     z3|t5           0.999      1.460    0.684    0.494
#>     z3|t6           1.675      2.005    0.835    0.404
#>     y1|t1          -2.796      0.871   -3.208    0.001
#>     y1|t2          -1.527      0.819   -1.864    0.062
#>     y1|t3          -0.682      0.892   -0.764    0.445
#>     y1|t4           0.515      0.886    0.581    0.561
#>     y1|t5           1.595      1.783    0.894    0.371
#>     y1|t6           2.505      2.249    1.114    0.265
#>     y2|t1          -2.965      1.073   -2.762    0.006
#>     y2|t2          -1.666      1.039   -1.603    0.109
#>     y2|t3          -0.996      1.079   -0.923    0.356
#>     y2|t4           0.296      1.191    0.248    0.804
#>     y2|t5           1.082      1.607    0.673    0.501
#>     y2|t6           2.301      1.634    1.408    0.159
#>     y3|t1          -1.689      1.071   -1.577    0.115
#>     y3|t2          -0.849      1.004   -0.845    0.398
#>     y3|t3           0.322      0.667    0.482    0.629
#>     y3|t4           1.349      0.563    2.397    0.017
#>     y3|t5           2.178      0.573    3.802    0.000
#> 
#> Variances:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>     X               1.000                             
#>     Z               1.000                             
#>    .Y               0.408      0.021   19.077    0.000
#>     X:Z             1.022      0.049   21.041    0.000
#>    .x1              0.190      0.030    6.432    0.000
#>    .x2              0.247      0.030    8.233    0.000
#>    .x3              0.271      0.032    8.564    0.000
#>    .z1              0.202      0.034    6.009    0.000
#>    .z2              0.245      0.033    7.379    0.000
#>    .z3              0.250      0.032    7.714    0.000
#>    .y1              0.152      0.021    7.384    0.000
#>    .y2              0.162      0.024    6.818    0.000
#>    .y3              0.152      0.020    7.437    0.000