pls() estimates Partial Least Squares Structural Equation Models (PLS-SEM)
and their consistent (PLSc) variants. The function accepts lavaan-style
syntax, handles ordered indicators through polychoric correlations and probit
factor scores, and supports multilevel specifications expressed with
lme4-style random effects terms inside the structural model.
pls(
syntax,
data,
standardize = TRUE,
consistent = TRUE,
bootstrap = FALSE,
ordered = NULL,
missing = c("listwise", "mean", "kNN"),
knn.k = 5,
mcpls = NULL,
mc.fast.lmer = mcpls,
probit = NULL,
tolerance = 1e-05,
max.iter.0_5 = 100L,
boot.ncores = 1L,
boot.ncpus = NULL,
boot.parallel = c("no", "multicore", "multisession", "snow"),
boot.R = 50L,
boot.iseed = NULL,
sample = NULL,
mc.min.iter = 5L,
mc.max.iter = 250L,
mc.reps = 20000L,
mc.fixed.seed = FALSE,
mc.polyak.juditsky = TRUE,
mc.pj.extrapolate = TRUE,
mc.tol = if (mc.polyak.juditsky) 5e-04 else 0.001,
mc.fn.args = list(),
verbose = interactive(),
boot.optimize = TRUE,
mc.boot.control = list(min.iter = mc.min.iter, max.iter = mc.max.iter, mc.reps =
floor(0.5 * mc.reps), tol = mc.tol, polyak.juditsky = mc.polyak.juditsky,
pj.extrapolate = FALSE, verbose = FALSE, fixed.seed = TRUE, reuse.p.start = TRUE),
reliabilities = NULL,
...
)Character string with lavaan-style model syntax describing
both measurement (=~) and structural (~) relations. Random effects are
specified with (term | cluster) statements.
A data.frame or coercible object containing the manifest
indicators referenced in syntax. Ordered factors are automatically
detected, but can also be supplied explicitly through ordered.
Logical; if TRUE, indicators are standardized before
estimation so that factor scores have comparable scales.
Logical; TRUE requests PLSc corrections, whereas FALSE
fits the traditional PLS model.
Logical; if TRUE, nonparametric bootstrap standard errors
are computed with boot.R resamples.
Optional character vector naming manifest indicators that should be treated as ordered when computing polychoric correlations.
Character string specifying how to handle missing indicator data.
"listwise" removes rows with missing values (listwise deletion).
"mean" imputes missing indicator values using simple univariate
imputation: the mean for continuous variables, the median for ordered variables
with more than two categories, and the mode for binary ordered variables (two
categories) or nominal variables.
"kNN" (or "knn") imputes missing indicator values using
k-nearest neighbors imputation (kNN). When missing = "kNN", rows with
all indicators missing are removed prior to imputation, and rows with missing
cluster values are removed for multilevel models.
Integer specifying the number of neighbors (k) used when
missing = "kNN".
Should the model be estimated using the Monte-Carlo Consistent Partial Least Squares (MC-PLSc) algorithm?
Should a faster (biased) GLS based estimator of the Mixed-Effects model be used in conjunction with the MC-PLS algorithm?
Logical; overrides the automatic choice of probit factor scores that is based on whether ordered indicators are present.
Numeric; Convergence criteria/tolerance.
Maximum number of PLS iterations performed when estimating the measurement and structural models.
Integer: number of workers to be used for parallel bootstrapping.
Parallel bootstrapping is enabled when boot.ncores > 1.
Deprecated alias for boot.ncores.
The type of parallel operation to be used (if any). The
default is "no". "multisession" runs the bootstrap using multiple
background R sessions (works on all platforms), while "multicore"
uses forked processes (not available on Windows). "snow" is kept for
backwards compatibility and is treated as an alias for "multisession".
Internally this is implemented using the future package
Integer giving the number of bootstrap resamples drawn when
bootstrap = TRUE.
An integer to set the bootstrap seed. Or NULL if no
reproducible results are needed. This works for both serial and parallel
settings. When boot.iseed is not NULL, .Random.seed (if it
exists) in the global environment is left untouched.
DEPRECATED. Integer giving the number of bootstrap resamples drawn when
bootstrap = TRUE.
Minimum number of iterations in MC-PLS algorithm.
Maximum number of iterations in MC-PLS algorithm.
Monte-Carlo sample size in MC-PLS algorithm.
Should a fixed seed be used in the MC-PLS algorithm? Setting a fixed seed will likely yield less accurate estimates, but can substantially improve the stability and computational efficiency of the algorithm.
Should the polyak.juditsky running average method be applied in the MC-PLS algorithm?
Logical; if TRUE (the default), the Polyak-Juditsky
convergence point is estimated via NLS exponential extrapolation (with
Aitken \(\delta^2\) as a fallback). If FALSE a warm start is performed
instead, and the plain Polyak-Juditsky average is used.
Only relevant when mc.polyak.juditsky = TRUE.
Tolerance in MC-PLS algorithm.
Additional arguments to MC-PLS algorithm, mainly for controlling the step size.
Should verbose output be printed?
Logical; if TRUE and bootstrap = TRUE, applies
the settings in mc.boot.control inside each bootstrap replicate (MC-PLS only).
In general it will lead to slightly larger and less accurate standard errors.
List of control parameters passed to the MC-PLS algorithm
inside each bootstrap replicate when boot.optimize = TRUE.
Optional named numeric vector of user-supplied reliabilities used for the PLSc consistency correction.
Internal arguments. For advanced users only.
A Plssem object containing the estimated parameters, fit measures,
factor scores, and any bootstrap results. Methods such as summary(),
coef(), and parameter_estimates() can be applied to inspect the fit.
# \donttest{
library(plssem)
library(modsem)
tpb <- '
ATT =~ att1 + att2 + att3 + att4 + att5
SN =~ sn1 + sn2
PBC =~ pbc1 + pbc2 + pbc3
INT =~ int1 + int2 + int3
BEH =~ b1 + b2
INT ~ ATT + SN + PBC
BEH ~ INT + PBC
'
fit <- pls(tpb, TPB, bootstrap = TRUE)
summary(fit)
#> 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 5
#> Number of observed variables 15
#>
#> Fit Measures:
#> Chi-Square 106.316
#> Degrees of Freedom 82
#> SRMR 0.008
#> RMSEA 0.012
#>
#> R-squared (indicators):
#> att1 0.847
#> att2 0.825
#> att3 0.805
#> att4 0.745
#> att5 0.845
#> sn1 0.817
#> sn2 0.863
#> pbc1 0.856
#> pbc2 0.859
#> pbc3 0.787
#> int1 0.816
#> int2 0.827
#> int3 0.742
#> b1 0.762
#> b2 0.821
#>
#> R-squared (latents):
#> INT 0.367
#> BEH 0.210
#>
#> Latent Variables:
#> Estimate Std.Error z.value P(>|z|)
#> ATT =~
#> att1 0.921 0.016 58.721 0.000
#> att2 0.908 0.015 61.683 0.000
#> att3 0.897 0.017 53.546 0.000
#> att4 0.863 0.017 51.241 0.000
#> att5 0.919 0.015 62.878 0.000
#> SN =~
#> sn1 0.904 0.012 73.883 0.000
#> sn2 0.929 0.013 71.128 0.000
#> PBC =~
#> pbc1 0.925 0.010 91.034 0.000
#> pbc2 0.927 0.011 81.180 0.000
#> pbc3 0.887 0.011 81.094 0.000
#> INT =~
#> int1 0.903 0.012 76.953 0.000
#> int2 0.909 0.012 79.033 0.000
#> int3 0.861 0.012 72.192 0.000
#> BEH =~
#> b1 0.873 0.014 62.208 0.000
#> b2 0.906 0.013 70.859 0.000
#>
#> Regressions:
#> Estimate Std.Error z.value P(>|z|)
#> INT ~
#> ATT 0.243 0.027 9.108 0.000
#> SN 0.201 0.031 6.498 0.000
#> PBC 0.240 0.031 7.845 0.000
#> BEH ~
#> PBC 0.308 0.028 11.125 0.000
#> INT 0.210 0.027 7.672 0.000
#>
#> Covariances:
#> Estimate Std.Error z.value P(>|z|)
#> ATT ~~
#> SN 0.633 0.015 43.425 0.000
#> PBC 0.692 0.011 62.529 0.000
#> SN ~~
#> PBC 0.696 0.013 52.332 0.000
#>
#> Variances:
#> Estimate Std.Error z.value P(>|z|)
#> ATT 1.000
#> SN 1.000
#> PBC 1.000
#> .INT 0.633 0.018 34.475 0.000
#> .BEH 0.790 0.017 47.795 0.000
#> .att1 0.153 0.029 5.318 0.000
#> .att2 0.175 0.027 6.551 0.000
#> .att3 0.195 0.030 6.439 0.000
#> .att4 0.255 0.029 8.722 0.000
#> .att5 0.155 0.027 5.765 0.000
#> .sn1 0.183 0.022 8.238 0.000
#> .sn2 0.137 0.024 5.630 0.000
#> .pbc1 0.144 0.019 7.647 0.000
#> .pbc2 0.141 0.021 6.693 0.000
#> .pbc3 0.213 0.019 10.959 0.000
#> .int1 0.184 0.021 8.689 0.000
#> .int2 0.173 0.021 8.295 0.000
#> .int3 0.258 0.020 12.635 0.000
#> .b1 0.238 0.025 9.700 0.000
#> .b2 0.179 0.023 7.698 0.000
#>
# }