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.1) 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.1) 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 116.130 0.000
#> x2 0.899 0.008 116.846 0.000
#> x3 0.905 0.007 126.799 0.000
#> Z =~
#> z1 0.936 0.009 108.993 0.000
#> z2 0.901 0.007 130.258 0.000
#> z3 0.910 0.008 118.124 0.000
#> Y =~
#> y1 0.971 0.005 206.958 0.000
#> y2 0.952 0.006 165.313 0.000
#> y3 0.962 0.005 212.355 0.000
#>
#> Regressions:
#> Estimate Std.Error z.value P(>|z|)
#> Y ~
#> X 0.418 0.020 20.850 0.000
#> Z 0.356 0.018 19.757 0.000
#> X:Z 0.447 0.020 22.407 0.000
#>
#> Covariances:
#> Estimate Std.Error z.value P(>|z|)
#> X ~~
#> Z 0.195 0.023 8.514 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.391 0.000
#> x1|t2 -0.830 0.031 -27.020 0.000
#> x1|t3 0.075 0.030 2.518 0.012
#> x1|t4 0.898 0.040 22.614 0.000
#> x1|t5 1.871 0.064 29.175 0.000
#> x2|t1 -2.555 0.121 -21.136 0.000
#> x2|t2 -1.570 0.050 -31.699 0.000
#> x2|t3 -0.420 0.033 -12.777 0.000
#> x2|t4 0.412 0.038 10.906 0.000
#> x2|t5 1.307 0.044 29.738 0.000
#> x2|t6 2.548 0.098 26.111 0.000
#> x3|t1 -2.370 0.103 -23.096 0.000
#> x3|t2 -1.253 0.039 -31.742 0.000
#> x3|t3 -0.087 0.034 -2.562 0.010
#> x3|t4 0.747 0.037 20.340 0.000
#> x3|t5 2.107 0.080 26.434 0.000
#> x3|t6 2.782 0.156 17.826 0.000
#> y1|t1 -2.832 0.251 -11.269 0.000
#> y1|t2 -1.496 0.050 -30.061 0.000
#> y1|t3 -0.678 0.025 -26.704 0.000
#> y1|t4 0.498 0.036 13.724 0.000
#> y1|t5 1.597 0.072 22.199 0.000
#> y1|t6 2.592 0.142 18.262 0.000
#> y2|t1 -2.997 0.329 -9.099 0.000
#> y2|t2 -1.653 0.054 -30.552 0.000
#> y2|t3 -0.990 0.032 -31.381 0.000
#> y2|t4 0.294 0.033 9.008 0.000
#> y2|t5 1.068 0.046 23.331 0.000
#> y2|t6 2.319 0.113 20.522 0.000
#> y3|t1 -1.664 0.056 -29.575 0.000
#> y3|t2 -0.849 0.028 -30.147 0.000
#> y3|t3 0.309 0.036 8.678 0.000
#> y3|t4 1.344 0.044 30.324 0.000
#> y3|t5 2.204 0.098 22.601 0.000
#> z1|t1 -2.040 0.061 -33.279 0.000
#> z1|t2 -0.776 0.033 -23.677 0.000
#> z1|t3 0.283 0.026 10.823 0.000
#> z1|t4 0.938 0.035 27.152 0.000
#> z1|t5 2.296 0.103 22.356 0.000
#> z1|t6 3.316 0.231 14.362 0.000
#> z2|t1 -2.894 0.215 -13.456 0.000
#> z2|t2 -1.610 0.049 -32.545 0.000
#> z2|t3 -0.742 0.027 -27.397 0.000
#> z2|t4 0.245 0.023 10.624 0.000
#> z2|t5 1.211 0.035 34.182 0.000
#> z2|t6 2.317 0.079 29.260 0.000
#> z3|t1 -3.343 0.353 -9.466 0.000
#> z3|t2 -1.970 0.053 -36.966 0.000
#> z3|t3 -1.281 0.036 -35.825 0.000
#> z3|t4 -0.205 0.024 -8.593 0.000
#> z3|t5 0.999 0.037 27.029 0.000
#> z3|t6 1.661 0.057 29.162 0.000
#>
#> Variances:
#> Estimate Std.Error z.value P(>|z|)
#> X 1.000
#> Z 1.000
#> .Y 0.432 0.027 16.202 0.000
#> X:Z 1.033
#> .x1 0.134 0.015 8.978 0.000
#> .x2 0.191 0.014 13.806 0.000
#> .x3 0.181 0.013 13.982 0.000
#> .z1 0.124 0.016 7.742 0.000
#> .z2 0.188 0.012 15.066 0.000
#> .z3 0.172 0.014 12.229 0.000
#> .y1 0.056 0.009 6.166 0.000
#> .y2 0.093 0.011 8.497 0.000
#> .y3 0.075 0.009 8.567 0.000