This vignette shows how to estimate interaction models, with both continuous and ordered (categorical) data.
m <- '
X =~ x1 + x2 + x3
Z =~ z1 + z2 + z3
Y =~ y1 + y2 + y3
Y ~ X + Z + X:Z
'fit_cont <- pls(
m,
data = modsem::oneInt,
bootstrap = TRUE,
boot.R = 50
)
summary(fit_cont)
#> plssem (0.1.1) ended normally after 3 iterations
#>
#> Estimator PLSc
#> Link PROBIT
#>
#> 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 74.628 0.000
#> x2 0.905 0.014 62.846 0.000
#> x3 0.899 0.014 64.168 0.000
#> Z =~
#> z1 0.911 0.012 75.965 0.000
#> z2 0.909 0.016 58.630 0.000
#> z3 0.918 0.015 59.250 0.000
#> Y =~
#> y1 0.966 0.006 158.761 0.000
#> y2 0.959 0.008 119.612 0.000
#> y3 0.961 0.007 143.590 0.000
#>
#> Regressions:
#> Estimate Std.Error z.value P(>|z|)
#> Y ~
#> X 0.423 0.018 23.768 0.000
#> Z 0.361 0.018 19.679 0.000
#> X:Z 0.452 0.017 26.844 0.000
#>
#> Covariances:
#> Estimate Std.Error z.value P(>|z|)
#> X ~~
#> Z 0.201 0.026 7.670 0.000
#> X:Z 0.018 0.027 0.666 0.506
#> Z ~~
#> X:Z 0.060 0.037 1.633 0.102
#>
#> Variances:
#> Estimate Std.Error z.value P(>|z|)
#> X 1.000
#> Z 1.000
#> .Y 0.396 0.019 21.127 0.000
#> X:Z 1.013 0.046 22.195 0.000
#> .x1 0.137 0.023 5.960 0.000
#> .x2 0.181 0.026 6.964 0.000
#> .x3 0.191 0.025 7.592 0.000
#> .z1 0.170 0.022 7.768 0.000
#> .z2 0.173 0.028 6.158 0.000
#> .z3 0.157 0.028 5.528 0.000
#> .y1 0.066 0.012 5.640 0.000
#> .y2 0.081 0.015 5.263 0.000
#> .y3 0.077 0.013 6.012 0.000fit_ord <- pls(
m,
data = oneIntOrdered,
bootstrap = TRUE,
boot.R = 50,
ordered = colnames(oneIntOrdered) # explicitly specify variables as ordered
)
summary(fit_ord)
#> plssem (0.1.1) ended normally after 67 iterations
#>
#> Estimator MCOrdPLSc
#> Link PROBIT
#>
#> Number of observations 2000
#> Number of iterations 67
#> Number of latent variables 3
#> Number of observed variables 9
#>
#> Fit Measures:
#> Chi-Square 21.265
#> Degrees of Freedom 21
#> SRMR 0.012
#> RMSEA 0.003
#>
#> R-squared (indicators):
#> x1 0.931
#> x2 0.899
#> x3 0.906
#> z1 0.935
#> z2 0.902
#> z3 0.912
#> y1 0.972
#> y2 0.952
#> y3 0.962
#>
#> R-squared (latents):
#> Y 0.552
#>
#> Latent Variables:
#> Estimate Std.Error z.value P(>|z|)
#> X =~
#> x1 0.931 0.007 140.249 0.000
#> x2 0.899 0.007 125.717 0.000
#> x3 0.906 0.007 134.623 0.000
#> Z =~
#> z1 0.935 0.007 137.175 0.000
#> z2 0.902 0.008 115.795 0.000
#> z3 0.912 0.007 137.624 0.000
#> Y =~
#> y1 0.972 0.005 206.485 0.000
#> y2 0.952 0.005 194.440 0.000
#> y3 0.962 0.004 236.331 0.000
#>
#> Regressions:
#> Estimate Std.Error z.value P(>|z|)
#> Y ~
#> X 0.415 0.021 19.877 0.000
#> Z 0.357 0.022 16.365 0.000
#> X:Z 0.448 0.017 25.748 0.000
#>
#> Covariances:
#> Estimate Std.Error z.value P(>|z|)
#> X ~~
#> Z 0.194 0.026 7.372 0.000
#> X:Z -0.004 0.014 -0.269 0.788
#> Z ~~
#> X:Z -0.009 0.012 -0.758 0.449
#>
#> Variances:
#> Estimate Std.Error z.value P(>|z|)
#> X 1.000
#> Z 1.000
#> .Y 0.448 0.028 16.050 0.000
#> X:Z 1.000
#> .x1 0.069 0.007 10.457 0.000
#> .x2 0.101 0.007 14.126 0.000
#> .x3 0.094 0.007 14.034 0.000
#> .z1 0.065 0.007 9.496 0.000
#> .z2 0.098 0.008 12.623 0.000
#> .z3 0.088 0.007 13.315 0.000
#> .y1 0.028 0.005 6.027 0.000
#> .y2 0.048 0.005 9.796 0.000
#> .y3 0.038 0.004 9.400 0.000
Need a high-speed mirror for your open-source project?
Contact our mirror admin team at info@clientvps.com.
This archive is provided as a free public service to the community.
Proudly supported by infrastructure from VPSPulse , RxServers , BuyNumber , UnitVPS , OffshoreName and secure payment technology by ArionPay.