| pls | R Documentation |
'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,
sample = 50L,
ordered = NULL,
mcpls = NULL,
probit = NULL,
tolerance = 1e-05,
max.iter.0_5 = 100L,
mc.min.iter = 5L,
mc.max.iter = 250L,
mc.reps = 20000L,
mc.tol = 0.001,
mc.fixed.seed = FALSE,
mc.polyak.juditsky = FALSE,
mc.fn.args = list(),
verbose = interactive(),
...
)
syntax |
Character string with 'lavaan'-style model syntax describing both measurement ('=~') and structural ('~') relations. Random effects are specified with '(term | cluster)' statements. |
data |
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'. |
standardize |
Logical; if 'TRUE', indicators are standardized before estimation so that factor scores have comparable scales. |
consistent |
Logical; 'TRUE' requests PLSc corrections, whereas 'FALSE' fits the traditional PLS model. |
bootstrap |
Logical; if 'TRUE', nonparametric bootstrap standard errors are computed with 'sample' resamples. |
sample |
Integer giving the number of bootstrap resamples drawn when 'bootstrap = TRUE'. |
ordered |
Optional character vector naming manifest indicators that should be treated as ordered when computing polychoric correlations. |
mcpls |
Should a Monte-Carlo consistency correction be applied? |
probit |
Logical; overrides the automatic choice of probit factor scores that is based on whether ordered indicators are present. |
tolerance |
Numeric; Convergence criteria/tolerance. |
max.iter.0_5 |
Maximum number of PLS iterations performed when estimating the measurement and structural models. |
mc.min.iter |
Minimum number of iterations in MC-PLS algorithm. |
mc.max.iter |
Maximum number of iterations in MC-PLS algorithm. |
mc.reps |
Monte-Carlo sample size in MC-PLS algorithm. |
mc.tol |
Tolerance in MC-PLS algorithm. |
mc.fixed.seed |
Should a fixed seed be used in the MC-PLS algorithm? |
mc.polyak.juditsky |
Should the polyak.juditsky running average method be applied in the MC-PLS algorithm? |
mc.fn.args |
Additional arguments to MC-PLS algorithm, mainly for controling the step size. |
verbose |
Should verbose output be printed? |
... |
Currently unused, reserved for future extensions. |
An object of class 'plssem' containing the estimated parameters, fit measures, factor scores, and any bootstrap results. Methods such as 'summary()', 'print()', and 'coef()' can be applied to inspect the fit.
[summary.plssem()], [print.plssem()]
# Linear Model with Continuous Data
library(plssem)
library(modsem)
tpb <- '
# Outer Model (Based on Hagger et al., 2007)
ATT =~ att1 + att2 + att3 + att4 + att5
SN =~ sn1 + sn2
PBC =~ pbc1 + pbc2 + pbc3
INT =~ int1 + int2 + int3
BEH =~ b1 + b2
# Inner Model (Based on Steinmetz et al., 2011)
INT ~ ATT + SN + PBC
BEH ~ INT + PBC
'
fit <- pls(tpb, TPB, bootstrap = TRUE)
summary(fit)
# Linear Model with Ordered Data
tpb <- '
# Outer Model (Based on Hagger et al., 2007)
ATT =~ att1 + att2 + att3 + att4 + att5
SN =~ sn1 + sn2
PBC =~ pbc1 + pbc2 + pbc3
INT =~ int1 + int2 + int3
BEH =~ b1 + b2
# Inner Model (Based on Steinmetz et al., 2011)
INT ~ ATT + SN + PBC
BEH ~ INT + PBC
'
fit <- pls(tpb, TPB_Ordered, bootstrap = TRUE)
summary(fit)
# Multilevel Random Slopes Model with Continuous Data
syntax <- "
X =~ x1 + x2 + x3
Z =~ z1 + z2 + z3
Y =~ y1 + y2 + y3
W =~ w1 + w2 + w3
Y ~ X + Z + (1 + X + Z | cluster)
W ~ X + Z + (1 + X + Z | cluster)
"
fit <- pls(syntax, data = randomSlopes, bootstrap = TRUE)
summary(fit)
# Multilevel Random Slopes Model with Ordered Data
syntax <- "
X =~ x1 + x2 + x3
Z =~ z1 + z2 + z3
Y =~ y1 + y2 + y3
W =~ w1 + w2 + w3
Y ~ X + Z + (1 + X + Z | cluster)
W ~ X + Z + (1 + X + Z | cluster)
"
fit <- pls(syntax, data = randomSlopesOrdered, bootstrap = TRUE)
summary(fit)
# Multilevel Random Intercepts Model with Continuous Data
syntax <- '
f =~ y1 + y2 + y3
f ~ x1 + x2 + x3 + w1 + w2 + (1 | cluster)
'
fit <- pls(syntax, data = randomIntercepts, bootstrap = TRUE)
summary(fit)
# Multilevel Random Intercepts Model with Ordered Data
syntax <- '
f =~ y1 + y2 + y3
f ~ x1 + x2 + x3 + w1 + w2 + (1 | cluster)
'
fit <- pls(syntax, data = randomInterceptsOrdered, bootstrap = TRUE)
summary(fit)
# Interaction Model with Continuous Data
m <- '
X =~ x1 + x2 + x3
Z =~ z1 + z2 + z3
Y =~ y1 + y2 + y3
Y ~ X + Z + X:Z
'
fit <- pls(m, modsem::oneInt, bootstrap = TRUE)
summary(fit)
# Interaction Model with Ordered Data
m <- '
X =~ x1 + x2 + x3
Z =~ z1 + z2 + z3
Y =~ y1 + y2 + y3
Y ~ X + Z + X:Z
'
fit <- pls(m, oneIntOrdered, bootstrap = TRUE)
summary(fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.