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.2) 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                                21
#>   SRMR                                           0.006
#>   RMSEA                                          0.029
#> 
#> 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.2) ended normally after 13 iterations
#>   Estimator                                  MCOrdPLSc
#>   Link                                          PROBIT
#>                                                       
#>   Number of observations                          2000
#>   Number of iterations                              13
#>   Number of latent variables                         3
#>   Number of observed variables                       9
#> 
#> Fit Measures:
#>   Chi-Square                                    20.221
#>   Degrees of Freedom                                21
#>   SRMR                                           0.012
#>   RMSEA                                          0.000
#> 
#> R-squared (indicators):
#>   x1                                             0.929
#>   x2                                             0.900
#>   x3                                             0.906
#>   z1                                             0.936
#>   z2                                             0.903
#>   z3                                             0.912
#>   y1                                             0.970
#>   y2                                             0.953
#>   y3                                             0.962
#> 
#> R-squared (latents):
#>   Y                                              0.554
#> 
#> Latent Variables:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>   X =~          
#>     x1              0.929      0.007  136.264    0.000
#>     x2              0.900      0.009   99.157    0.000
#>     x3              0.906      0.008  119.169    0.000
#>   Z =~          
#>     z1              0.936      0.009  106.614    0.000
#>     z2              0.903      0.009   98.216    0.000
#>     z3              0.912      0.008  120.827    0.000
#>   Y =~          
#>     y1              0.970      0.004  225.334    0.000
#>     y2              0.953      0.005  177.485    0.000
#>     y3              0.962      0.004  217.936    0.000
#> 
#> Regressions:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>   Y ~           
#>     X               0.419      0.020   21.466    0.000
#>     Z               0.355      0.017   21.328    0.000
#>     X:Z             0.445      0.023   19.293    0.000
#> 
#> Covariances:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>   X ~~          
#>     Z               0.193      0.027    7.025    0.000
#>     X:Z            -0.006      0.015   -0.410    0.682
#>   Z ~~          
#>     X:Z             0.006      0.018    0.321    0.748
#> 
#> Variances:
#>                  Estimate  Std.Error  z.value  P(>|z|)
#>     X               1.000                             
#>     Z               1.000                             
#>    .Y               0.446      0.033   13.489    0.000
#>     X:Z             1.000                             
#>    .x1              0.071      0.007   10.463    0.000
#>    .x2              0.100      0.009   10.957    0.000
#>    .x3              0.094      0.008   12.417    0.000
#>    .z1              0.064      0.009    7.300    0.000
#>    .z2              0.097      0.009   10.601    0.000
#>    .z3              0.088      0.008   11.683    0.000
#>    .y1              0.030      0.004    6.855    0.000
#>    .y2              0.047      0.005    8.838    0.000
#>    .y3              0.038      0.004    8.602    0.000