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.4) ended normally after 2 iterations
#>   Estimator                                       PLSc
#>   Link                                          LINEAR
#>                                                       
#>   Number of observations                          2000
#>   Number of iterations                               2
#>   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.4) 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.473
#>   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.568
#> 
#> Latent Variables:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>   X =~          
#>     x1              0.931      0.006  147.956    0.000
#>     x2              0.899      0.008  118.660    0.000
#>     x3              0.905      0.009  104.865    0.000
#>   Z =~          
#>     z1              0.936      0.006  148.135    0.000
#>     z2              0.901      0.008  106.847    0.000
#>     z3              0.910      0.007  129.811    0.000
#>   Y =~          
#>     y1              0.971      0.005  180.483    0.000
#>     y2              0.952      0.005  181.682    0.000
#>     y3              0.962      0.004  242.161    0.000
#> 
#> Regressions:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>   Y ~           
#>     X               0.418      0.022   19.414    0.000
#>     Z               0.356      0.019   18.936    0.000
#>     X:Z             0.447      0.020   22.740    0.000
#> 
#> Covariances:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>   X ~~          
#>     Z               0.195      0.025    7.726    0.000
#>     X:Z             0.003                             
#>   Z ~~          
#>     X:Z             0.008                             
#> 
#> Thresholds:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>     x1|t1          -2.147      0.090  -23.817    0.000
#>     x1|t2          -0.830      0.032  -25.823    0.000
#>     x1|t3           0.075      0.022    3.409    0.001
#>     x1|t4           0.898      0.028   32.043    0.000
#>     x1|t5           1.871      0.059   31.812    0.000
#>     x2|t1          -2.555      0.064  -40.192    0.000
#>     x2|t2          -1.570      0.045  -35.270    0.000
#>     x2|t3          -0.420      0.028  -14.866    0.000
#>     x2|t4           0.412      0.026   15.604    0.000
#>     x2|t5           1.307      0.038   34.661    0.000
#>     x2|t6           2.548      0.061   41.757    0.000
#>     x3|t1          -2.370      0.070  -34.091    0.000
#>     x3|t2          -1.253      0.035  -36.065    0.000
#>     x3|t3          -0.087      0.025   -3.498    0.000
#>     x3|t4           0.747      0.025   30.314    0.000
#>     x3|t5           2.107      0.079   26.730    0.000
#>     x3|t6           2.782      0.067   41.300    0.000
#>     y1|t1          -2.832      0.092  -30.740    0.000
#>     y1|t2          -1.496      0.053  -28.298    0.000
#>     y1|t3          -0.678      0.031  -22.220    0.000
#>     y1|t4           0.498      0.038   13.139    0.000
#>     y1|t5           1.597      0.062   25.714    0.000
#>     y1|t6           2.592      0.127   20.436    0.000
#>     y2|t1          -2.997      0.119  -25.238    0.000
#>     y2|t2          -1.653      0.062  -26.649    0.000
#>     y2|t3          -0.990      0.033  -30.371    0.000
#>     y2|t4           0.294      0.032    9.131    0.000
#>     y2|t5           1.068      0.050   21.276    0.000
#>     y2|t6           2.319      0.097   23.979    0.000
#>     y3|t1          -1.664      0.062  -26.917    0.000
#>     y3|t2          -0.849      0.031  -27.509    0.000
#>     y3|t3           0.309      0.038    8.147    0.000
#>     y3|t4           1.344      0.050   27.089    0.000
#>     y3|t5           2.204      0.091   24.359    0.000
#>     z1|t1          -2.040      0.075  -27.350    0.000
#>     z1|t2          -0.776      0.027  -29.163    0.000
#>     z1|t3           0.283      0.030    9.305    0.000
#>     z1|t4           0.938      0.032   29.559    0.000
#>     z1|t5           2.296      0.102   22.464    0.000
#>     z1|t6           3.316      0.054   61.315    0.000
#>     z2|t1          -2.894      0.053  -54.445    0.000
#>     z2|t2          -1.610      0.042  -37.998    0.000
#>     z2|t3          -0.742      0.032  -22.891    0.000
#>     z2|t4           0.245      0.031    7.935    0.000
#>     z2|t5           1.211      0.041   29.649    0.000
#>     z2|t6           2.317      0.108   21.381    0.000
#>     z3|t1          -3.343      0.056  -60.130    0.000
#>     z3|t2          -1.970      0.054  -36.155    0.000
#>     z3|t3          -1.281      0.036  -35.373    0.000
#>     z3|t4          -0.205      0.033   -6.279    0.000
#>     z3|t5           0.999      0.034   29.189    0.000
#>     z3|t6           1.661      0.044   37.386    0.000
#> 
#> Variances:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>     X               1.000                             
#>     Z               1.000                             
#>    .Y               0.432      0.029   14.925    0.000
#>     X:Z             1.033                             
#>    .x1              0.134      0.012   11.438    0.000
#>    .x2              0.191      0.014   14.021    0.000
#>    .x3              0.181      0.016   11.563    0.000
#>    .z1              0.124      0.012   10.523    0.000
#>    .z2              0.188      0.015   12.358    0.000
#>    .z3              0.172      0.013   13.439    0.000
#>    .y1              0.056      0.010    5.377    0.000
#>    .y2              0.093      0.010    9.339    0.000
#>    .y3              0.075      0.008    9.770    0.000