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,
  boot.R    = 50
)
summary(fit_cont)
#> plssem (0.1.3) 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
#> 
#> Fit Measures:
#>   Chi-Square                                    56.757
#>   Degrees of Freedom                                24
#>   SRMR                                           0.006
#>   RMSEA                                          0.026
#> 
#> 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.012   75.834    0.000
#>     x2              0.905      0.015   61.806    0.000
#>     x3              0.899      0.013   70.530    0.000
#>   Z =~          
#>     z1              0.911      0.011   79.973    0.000
#>     z2              0.909      0.015   61.911    0.000
#>     z3              0.918      0.012   77.681    0.000
#>   Y =~          
#>     y1              0.966      0.006  174.278    0.000
#>     y2              0.959      0.008  116.493    0.000
#>     y3              0.961      0.006  147.962    0.000
#> 
#> Regressions:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>   Y ~           
#>     X               0.423      0.020   21.233    0.000
#>     Z               0.361      0.017   21.096    0.000
#>     X:Z             0.452      0.017   27.255    0.000
#> 
#> Covariances:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>   X ~~          
#>     Z               0.201      0.023    8.869    0.000
#>     X:Z             0.018      0.040    0.455    0.649
#>   Z ~~          
#>     X:Z             0.060      0.048    1.267    0.205
#> 
#> Variances:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>     X               1.000      0.022   45.244    0.000
#>     Z               1.000      0.033   30.396    0.000
#>    .Y               0.396      0.017   23.234    0.000
#>     X:Z             1.013      0.061   16.594    0.000
#>    .x1              0.137      0.023    6.034    0.000
#>    .x2              0.181      0.026    6.834    0.000
#>    .x3              0.191      0.023    8.333    0.000
#>    .z1              0.170      0.021    8.181    0.000
#>    .z2              0.173      0.027    6.493    0.000
#>    .z3              0.157      0.022    7.226    0.000
#>    .y1              0.066      0.011    6.167    0.000
#>    .y2              0.081      0.016    5.157    0.000
#>    .y3              0.077      0.012    6.201    0.000

Ordered Indicators

fit_ord <- pls(
  m,
  data      = oneIntOrdered,
  bootstrap = TRUE,
  boot.R    = 50,
  ordered   = colnames(oneIntOrdered) # explicitly specify variables as ordered
)
summary(fit_ord)
#> plssem (0.1.3) ended normally after 53 iterations
#>   Estimator                                  MCOrdPLSc
#>   Link                                          PROBIT
#>                                                       
#>   Number of observations                          2000
#>   Number of iterations                              53
#>   Number of latent variables                         3
#>   Number of observed variables                       9
#> 
#> Fit Measures:
#>   Chi-Square                                    20.103
#>   Degrees of Freedom                                24
#>   SRMR                                           0.012
#>   RMSEA                                          0.000
#> 
#> R-squared (indicators):
#>   x1                                             0.866
#>   x2                                             0.809
#>   x3                                             0.819
#>   z1                                             0.876
#>   z2                                             0.812
#>   z3                                             0.828
#>   y1                                             0.944
#>   y2                                             0.907
#>   y3                                             0.925
#> 
#> R-squared (latents):
#>   Y                                              0.564
#> 
#> Latent Variables:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>   X =~          
#>     x1              0.931      0.011   86.281    0.000
#>     x2              0.899      0.008  106.071    0.000
#>     x3              0.905      0.007  127.506    0.000
#>   Z =~          
#>     z1              0.936      0.008  113.824    0.000
#>     z2              0.901      0.007  126.624    0.000
#>     z3              0.910      0.010   87.731    0.000
#>   Y =~          
#>     y1              0.971      0.004  253.736    0.000
#>     y2              0.952      0.006  166.008    0.000
#>     y3              0.962      0.004  226.279    0.000
#> 
#> Regressions:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>   Y ~           
#>     X               0.418      0.016   26.246    0.000
#>     Z               0.356      0.020   17.577    0.000
#>     X:Z             0.447      0.018   24.546    0.000
#> 
#> Covariances:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>   X ~~          
#>     Z               0.195      0.019   10.061    0.000
#>     X:Z            -0.003                             
#>   Z ~~          
#>     X:Z            -0.008                             
#> 
#> Thresholds:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>     x1|t1          -2.189      0.083  -26.235    0.000
#>     x1|t2          -0.836      0.036  -23.275    0.000
#>     x1|t3           0.088      0.031    2.837    0.005
#>     x1|t4           0.892      0.034   26.318    0.000
#>     x1|t5           1.861      0.063   29.517    0.000
#>     x2|t1          -2.560      0.063  -40.683    0.000
#>     x2|t2          -1.601      0.050  -32.104    0.000
#>     x2|t3          -0.417      0.033  -12.810    0.000
#>     x2|t4           0.423      0.030   13.867    0.000
#>     x2|t5           1.298      0.040   32.216    0.000
#>     x2|t6           2.474      0.059   41.864    0.000
#>     x3|t1          -2.370      0.061  -38.963    0.000
#>     x3|t2          -1.246      0.043  -28.749    0.000
#>     x3|t3          -0.079      0.029   -2.757    0.006
#>     x3|t4           0.751      0.030   24.678    0.000
#>     x3|t5           2.087      0.074   28.184    0.000
#>     x3|t6           2.729      0.062   43.756    0.000
#>     y1|t1          -2.746      0.088  -31.037    0.000
#>     y1|t2          -1.490      0.037  -40.021    0.000
#>     y1|t3          -0.688      0.032  -21.630    0.000
#>     y1|t4           0.509      0.039   13.144    0.000
#>     y1|t5           1.607      0.061   26.236    0.000
#>     y1|t6           2.539      0.173   14.705    0.000
#>     y2|t1          -3.082      0.079  -38.962    0.000
#>     y2|t2          -1.642      0.062  -26.667    0.000
#>     y2|t3          -0.994      0.036  -27.530    0.000
#>     y2|t4           0.287      0.037    7.845    0.000
#>     y2|t5           1.090      0.051   21.498    0.000
#>     y2|t6           2.301      0.136   16.943    0.000
#>     y3|t1          -1.678      0.044  -38.553    0.000
#>     y3|t2          -0.845      0.029  -29.003    0.000
#>     y3|t3           0.309      0.033    9.227    0.000
#>     y3|t4           1.363      0.047   28.704    0.000
#>     y3|t5           2.181      0.121   18.074    0.000
#>     z1|t1          -2.020      0.071  -28.356    0.000
#>     z1|t2          -0.775      0.032  -23.972    0.000
#>     z1|t3           0.287      0.024   11.760    0.000
#>     z1|t4           0.945      0.038   24.936    0.000
#>     z1|t5           2.286      0.109   21.032    0.000
#>     z1|t6           3.214      0.054   59.935    0.000
#>     z2|t1          -2.868      0.067  -42.991    0.000
#>     z2|t2          -1.598      0.050  -31.911    0.000
#>     z2|t3          -0.747      0.033  -22.980    0.000
#>     z2|t4           0.245      0.027    8.926    0.000
#>     z2|t5           1.218      0.039   31.264    0.000
#>     z2|t6           2.289      0.164   13.985    0.000
#>     z3|t1          -3.307      0.044  -75.617    0.000
#>     z3|t2          -1.966      0.074  -26.429    0.000
#>     z3|t3          -1.281      0.046  -27.754    0.000
#>     z3|t4          -0.197      0.029   -6.890    0.000
#>     z3|t5           1.001      0.032   30.936    0.000
#>     z3|t6           1.676      0.046   36.261    0.000
#> 
#> Variances:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>     X               1.000                             
#>     Z               1.000                             
#>    .Y               0.436      0.029   14.905    0.000
#>     X:Z             1.034                             
#>    .x1              0.134      0.020    6.670    0.000
#>    .x2              0.191      0.015   12.533    0.000
#>    .x3              0.181      0.013   14.060    0.000
#>    .z1              0.124      0.015    8.085    0.000
#>    .z2              0.188      0.013   14.646    0.000
#>    .z3              0.172      0.019    9.083    0.000
#>    .y1              0.056      0.007    7.560    0.000
#>    .y2              0.093      0.011    8.533    0.000
#>    .y3              0.075      0.008    9.129    0.000