This vignette shows how to estimate interaction models, with both continuous and ordered (categorical) data.
fit_cont <- pls(
m,
data = modsem::oneInt,
bootstrap = TRUE,
boot.R = 50
)
summary(fit_cont)
#> plssem (0.2.0) 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.177 0.000
#> Z 0.361 0.017 20.691 0.000
#> X:Z 0.452 0.019 23.865 0.000
#>
#> Covariances:
#> Estimate Std.Error z.value P(>|z|)
#> X ~~
#> Z 0.201 0.021 9.678 0.000
#> X:Z 0.018 0.031 0.590 0.555
#> Z ~~
#> X:Z 0.060 0.035 1.744 0.081
#>
#> Variances:
#> Estimate Std.Error z.value P(>|z|)
#> X 1.000
#> Z 1.000
#> .Y 0.396 0.022 18.134 0.000
#> X:Z 1.013 0.042 23.886 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
fit_ord <- pls(
m,
data = oneIntOrdered,
bootstrap = TRUE,
boot.R = 50,
ordered = colnames(oneIntOrdered) # explicitly specify variables as ordered
)
summary(fit_ord)
#> plssem (0.2.0) ended normally after 53 iterations
#> Estimator MC-OrdPLSc
#> 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.536
#> Degrees of Freedom 24
#> SRMR 0.011
#> 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.008 120.565 0.000
#> x2 0.899 0.007 127.473 0.000
#> x3 0.905 0.007 132.185 0.000
#> Z =~
#> z1 0.936 0.008 110.779 0.000
#> z2 0.901 0.007 132.182 0.000
#> z3 0.910 0.009 106.399 0.000
#> Y =~
#> y1 0.971 0.005 196.433 0.000
#> y2 0.952 0.006 169.794 0.000
#> y3 0.962 0.005 175.403 0.000
#>
#> Regressions:
#> Estimate Std.Error z.value P(>|z|)
#> Y ~
#> X 0.418 0.020 20.417 0.000
#> Z 0.356 0.019 18.975 0.000
#> X:Z 0.447 0.020 22.541 0.000
#>
#> Covariances:
#> Estimate Std.Error z.value P(>|z|)
#> X ~~
#> Z 0.195 0.023 8.471 0.000
#> X:Z 0.003
#> Z ~~
#> X:Z 0.008
#>
#> Thresholds:
#> Estimate Std.Error z.value P(>|z|)
#> x1|t1 -2.147 0.076 -28.377 0.000
#> x1|t2 -0.830 0.031 -26.932 0.000
#> x1|t3 0.075 0.030 2.515 0.012
#> x1|t4 0.898 0.040 22.439 0.000
#> x1|t5 1.871 0.064 29.307 0.000
#> x2|t1 -2.555 0.121 -21.061 0.000
#> x2|t2 -1.570 0.048 -32.684 0.000
#> x2|t3 -0.420 0.033 -12.830 0.000
#> x2|t4 0.412 0.037 11.130 0.000
#> x2|t5 1.307 0.044 29.766 0.000
#> x2|t6 2.548 0.097 26.301 0.000
#> x3|t1 -2.370 0.103 -23.110 0.000
#> x3|t2 -1.253 0.040 -31.151 0.000
#> x3|t3 -0.087 0.033 -2.620 0.009
#> x3|t4 0.747 0.040 18.803 0.000
#> x3|t5 2.107 0.080 26.499 0.000
#> x3|t6 2.782 0.158 17.643 0.000
#> y1|t1 -2.832 0.253 -11.186 0.000
#> y1|t2 -1.496 0.051 -29.348 0.000
#> y1|t3 -0.678 0.025 -27.402 0.000
#> y1|t4 0.498 0.036 13.957 0.000
#> y1|t5 1.597 0.067 23.915 0.000
#> y1|t6 2.592 0.147 17.609 0.000
#> y2|t1 -2.997 0.326 -9.202 0.000
#> y2|t2 -1.653 0.053 -30.967 0.000
#> y2|t3 -0.990 0.033 -30.018 0.000
#> y2|t4 0.294 0.032 9.313 0.000
#> y2|t5 1.068 0.049 21.676 0.000
#> y2|t6 2.319 0.113 20.448 0.000
#> y3|t1 -1.664 0.060 -27.774 0.000
#> y3|t2 -0.849 0.029 -29.625 0.000
#> y3|t3 0.309 0.035 8.850 0.000
#> y3|t4 1.344 0.045 29.791 0.000
#> y3|t5 2.204 0.095 23.242 0.000
#> z1|t1 -2.040 0.062 -33.083 0.000
#> z1|t2 -0.776 0.033 -23.803 0.000
#> z1|t3 0.283 0.026 11.060 0.000
#> z1|t4 0.938 0.037 25.600 0.000
#> z1|t5 2.296 0.103 22.246 0.000
#> z1|t6 3.316 0.234 14.180 0.000
#> z2|t1 -2.894 0.217 -13.340 0.000
#> z2|t2 -1.610 0.048 -33.786 0.000
#> z2|t3 -0.742 0.028 -26.607 0.000
#> z2|t4 0.245 0.021 11.404 0.000
#> z2|t5 1.211 0.035 34.932 0.000
#> z2|t6 2.317 0.079 29.391 0.000
#> z3|t1 -3.343 0.358 -9.337 0.000
#> z3|t2 -1.970 0.054 -36.611 0.000
#> z3|t3 -1.281 0.036 -36.047 0.000
#> z3|t4 -0.205 0.023 -8.799 0.000
#> z3|t5 0.999 0.038 26.251 0.000
#> z3|t6 1.661 0.055 30.103 0.000
#>
#> Variances:
#> Estimate Std.Error z.value P(>|z|)
#> X 1.000
#> Z 1.000
#> .Y 0.432 0.027 16.130 0.000
#> X:Z 1.033
#> .x1 0.134 0.014 9.321 0.000
#> .x2 0.191 0.013 15.062 0.000
#> .x3 0.181 0.012 14.576 0.000
#> .z1 0.124 0.016 7.869 0.000
#> .z2 0.188 0.012 15.289 0.000
#> .z3 0.172 0.016 11.015 0.000
#> .y1 0.056 0.010 5.853 0.000
#> .y2 0.093 0.011 8.728 0.000
#> .y3 0.075 0.011 7.076 0.000