| Title: | Complex Partial Least Squares Structural Equation Modeling |
|---|---|
| Description: | Estimate complex Structural Equation Models (SEMs) by fitting Partial Least Squares Structural Equation Modeling (PLS-SEM) and Partial Least Squares consistent Structural Equation Modeling (PLSc-SEM) specifications that handle categorical data, non-linear relations, and multilevel structures. The implementation follows Lohmöller (1989) for the classic PLS-SEM algorithm, Dijkstra and Henseler (2015) for consistent PLSc-SEM, Dijkstra et al., (2014) for nonlinear PLSc-SEM, and Schuberth, Henseler, Dijkstra (2018) for ordinal PLS-SEM and PLSc-SEM. Additional extensions are under development. The MC-OrdPLSc algorithm, used to handle ordinal interaction models is detailed in Slupphaug et al., (2026). References: Lohmöller, J.-B. (1989, ISBN:9783790803002). "Latent Variable Path Modeling with Partial Least Squares." Dijkstra, T. K., & Henseler, J. (2015). <doi:10.1016/j.jmva.2015.06.002>. "Consistent partial least squares path modeling." Dijkstra, T. K., & Schermelleh-Engel, K. (2014). <doi:10.1016/j.csda.2014.07.008>. "Consistent partial least squares for nonlinear structural equation models." Schuberth, F., Henseler, J., & Dijkstra, T. K. (2018). <doi:10.1007/s11135-018-0767-9>. "Partial least squares path modeling using ordinal categorical indicators." Slupphaug, K. Mehmetoglu, M. & Mittner, M. (2026). <doi:10.31234/osf.io/fwzj6_v1>. "Consistent Estimates from Biased Estimators: Monte-Carlo Consistent Partial Least Squares for Latent Interaction Models with Ordinal Indicators." |
| Authors: | Kjell Solem Slupphaug [aut, cre] (ORCID: <https://orcid.org/0009-0005-8324-2834>) |
| Maintainer: | Kjell Solem Slupphaug <[email protected]> |
| License: | GPL-3 |
| Version: | 0.2.0 |
| Built: | 2026-10-12 16:26:05 UTC |
| Source: | https://github.com/kss2k/plssem |
Retrieve bootstrap coefficient matrix
boot(object) ## S4 method for signature 'PlsModel' boot(object) ## S4 method for signature 'PlsModel' pls_boot(object)boot(object) ## S4 method for signature 'PlsModel' boot(object) ## S4 method for signature 'PlsModel' pls_boot(object)
object |
A fitted model object. |
A PlsSemMatrix of bootstrap replicate parameter vectors
(rows = replicates, cols = parameters).
library(modsem) library(plssem) m <- " X =~ x1 + x2 + x3 Z =~ z1 + z2 + z3 Y =~ y1 + y2 + y3 Y ~ X + Z + X:Z " fit <- pls(m, oneInt, bootstrap = TRUE, boot.R = 50) boot(fit)library(modsem) library(plssem) m <- " X =~ x1 + x2 + x3 Z =~ z1 + z2 + z3 Y =~ y1 + y2 + y3 Y ~ X + Z + X:Z " fit <- pls(m, oneInt, bootstrap = TRUE, boot.R = 50) boot(fit)
PlsModel modelExtract coefficients from a PlsModel model
## S4 method for signature 'PlsModel' coef(object, use.labels = TRUE, ...) ## S4 method for signature 'PlsModel' coefficients(object, use.labels = TRUE, ...)## S4 method for signature 'PlsModel' coef(object, use.labels = TRUE, ...) ## S4 method for signature 'PlsModel' coefficients(object, use.labels = TRUE, ...)
object |
A |
use.labels |
Logical; Should parameter labels be used as names? |
... |
Currently unused. |
A named PlsSemVector of parameter estimates.
PlsMultilevelModel modelParameters at the between level (level 2) are suffixed with .l2.
## S4 method for signature 'PlsMultilevelModel' coef(object, ...) ## S4 method for signature 'PlsMultilevelModel' coefficients(object, ...)## S4 method for signature 'PlsMultilevelModel' coef(object, ...) ## S4 method for signature 'PlsMultilevelModel' coefficients(object, ...)
object |
A |
... |
Currently unused. |
A named PlsSemVector of parameter estimates.
Computes global fit measures (e.g., chi-square, SRMR, RMSEA) for a fitted model.
fit_measures(object, saturated = FALSE, mc.reps = 1e+06, ...) ## S4 method for signature 'PlsModel' fit_measures(object, saturated = FALSE, mc.reps = 1e+06, ...)fit_measures(object, saturated = FALSE, mc.reps = 1e+06, ...) ## S4 method for signature 'PlsModel' fit_measures(object, saturated = FALSE, mc.reps = 1e+06, ...)
object |
A fitted [PlsModel] object. |
saturated |
Logical; if 'TRUE', compute the saturated fit. |
mc.reps |
Integer; number of Monte Carlo resamples used for MC-PLSc fit. |
... |
Reserved for future extensions. |
A named list with fit statistics.
PlsMultilevelModel objectsComputes the fit measures (chi-square, SRMR, RMSEA) for each level. The observed (auxiliary) correlation matrices of the levels are compared with the ones implied by the model.
## S4 method for signature 'PlsMultilevelModel' fit_measures(object, saturated = FALSE, mc.reps = 1e+06, ...)## S4 method for signature 'PlsMultilevelModel' fit_measures(object, saturated = FALSE, mc.reps = 1e+06, ...)
object |
A |
saturated |
Logical; if |
mc.reps |
Integer; number of observations in the simulated data. |
... |
Currently unused. |
A list with the fit measures of each level (level.1 and level.2).
Check whether a fitted model has admissible parameter estimates
is_admissible(object) ## S4 method for signature 'PlsModel' is_admissible(object) ## S4 method for signature 'PlsMultilevelModel' is_admissible(object)is_admissible(object) ## S4 method for signature 'PlsModel' is_admissible(object) ## S4 method for signature 'PlsMultilevelModel' is_admissible(object)
object |
A fitted |
A single logical value.
Check whether an object uses the MC-OrdPLSc estimator
is_mcpls(object) ## S4 method for signature 'PlsModel' is_mcpls(object)is_mcpls(object) ## S4 method for signature 'PlsModel' is_mcpls(object)
object |
A fitted model object. |
TRUE or FALSE.
Compute Loglikelihood statistics for an MC-PLS model.
mcpls_loglik(object, boot.R = 500, verbose = interactive(), ...) ## S4 method for signature 'PlsModel' mcpls_loglik(object, boot.R = 500, verbose = interactive(), ...)mcpls_loglik(object, boot.R = 500, verbose = interactive(), ...) ## S4 method for signature 'PlsModel' mcpls_loglik(object, boot.R = 500, verbose = interactive(), ...)
object |
A fitted [PlsModel] object, using MC-PLS. |
boot.R |
Integer; Number of bootstrap replicates. |
verbose |
Logical; Should a progressbar be displayed? |
... |
Reserved for future extensions. |
List with loglikelihood value, expected and observed auxiliary parameters, and variance covariance matrix of the expected auxiliary parameters.
A simulated dataset.
m <- ' X =~ x1 + x2 + x3 Z =~ z1 + z2 + z3 Y =~ y1 + y2 + y3 Y ~ X + Z + X:Z ' fit <- pls(m, oneIntOrdered) summary(fit)m <- ' X =~ x1 + x2 + x3 Z =~ z1 + z2 + z3 Y =~ y1 + y2 + y3 Y ~ X + Z + X:Z ' fit <- pls(m, oneIntOrdered) summary(fit)
Generic accessor for model parameter estimates
parameter_estimates(object, ...)parameter_estimates(object, ...)
object |
A fitted model object. |
... |
Additional arguments passed to methods. |
A parameter table describing the fitted model.
PlsModel objectsParameter estimates for PlsModel objects
## S4 method for signature 'PlsModel' parameter_estimates(object, colon.pi = TRUE, label.renamed.prod = FALSE, ...)## S4 method for signature 'PlsModel' parameter_estimates(object, colon.pi = TRUE, label.renamed.prod = FALSE, ...)
object |
A |
colon.pi |
Logical; replace product-indicator labels with colon
notation ( |
label.renamed.prod |
Logical; retain renamed product labels when colon expansion occurs. |
... |
Currently unused. |
A PlsSemParTable data frame.
PlsMultilevelModel objectsParameter estimates for PlsMultilevelModel objects
## S4 method for signature 'PlsMultilevelModel' parameter_estimates(object, ...)## S4 method for signature 'PlsMultilevelModel' parameter_estimates(object, ...)
object |
A |
... |
Currently unused. |
A PlsSemParTable data frame, with a level column.
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 estimates two-level (multilevel) models, with separate
models for the within (level: 1) and between (level: 2) levels.
pls( syntax, data, standardize = TRUE, consistent = NULL, bootstrap = FALSE, ordered = NULL, missing = c("listwise", "mean", "kNN"), knn.k = 5, mcpls = NULL, probit = NULL, tolerance = 1e-05, max.iter.0_5 = 500L, boot.ncores = 1L, boot.ncpus = NULL, boot.parallel = c("no", "multicore", "multisession", "snow"), boot.R = 500L, boot.iseed = NULL, sample = NULL, mc.min.iter = 50L, mc.max.iter = 1000L, mc.reps = 20000L, mc.fixed.seed = FALSE, mc.polyak.juditsky = TRUE, mc.pj.extrapolate = TRUE, mc.tol = if (mc.polyak.juditsky) 1e-04 else 0.001, mc.delta.se = TRUE, mc.delta.jacobian.k = max(floor(boot.R/100L), 1), mc.fn.args = list(), mc.rescov = c("auto", "reduced", "full"), mc.diag.secant = FALSE, mc.small.sample = FALSE, mc.small.sample.max.k = 100L, mc.small.sample.point.estimate = c("median", "mean"), verbose = interactive(), boot.optimize = TRUE, boot.drop.inadmissible = FALSE, 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, default.path.estimator = c("ols", "gls", "lmer"), cluster = NULL, inner.weights = c("path", "centroid", "factorial"), approach.weights = c("pls", "pca"), mlm = NULL, level2.cov = c("muml", "means"), level2.approach.weights = c("pca", "pls"), ... )pls( syntax, data, standardize = TRUE, consistent = NULL, bootstrap = FALSE, ordered = NULL, missing = c("listwise", "mean", "kNN"), knn.k = 5, mcpls = NULL, probit = NULL, tolerance = 1e-05, max.iter.0_5 = 500L, boot.ncores = 1L, boot.ncpus = NULL, boot.parallel = c("no", "multicore", "multisession", "snow"), boot.R = 500L, boot.iseed = NULL, sample = NULL, mc.min.iter = 50L, mc.max.iter = 1000L, mc.reps = 20000L, mc.fixed.seed = FALSE, mc.polyak.juditsky = TRUE, mc.pj.extrapolate = TRUE, mc.tol = if (mc.polyak.juditsky) 1e-04 else 0.001, mc.delta.se = TRUE, mc.delta.jacobian.k = max(floor(boot.R/100L), 1), mc.fn.args = list(), mc.rescov = c("auto", "reduced", "full"), mc.diag.secant = FALSE, mc.small.sample = FALSE, mc.small.sample.max.k = 100L, mc.small.sample.point.estimate = c("median", "mean"), verbose = interactive(), boot.optimize = TRUE, boot.drop.inadmissible = FALSE, 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, default.path.estimator = c("ols", "gls", "lmer"), cluster = NULL, inner.weights = c("path", "centroid", "factorial"), approach.weights = c("pls", "pca"), mlm = NULL, level2.cov = c("muml", "means"), level2.approach.weights = c("pca", "pls"), ... )
syntax |
Character string with |
data |
A |
standardize |
Logical; if |
consistent |
Logical; |
bootstrap |
Logical; if |
ordered |
Optional character vector naming manifest indicators that should be treated as ordered when computing polychoric correlations. |
missing |
Character string specifying how to handle missing indicator data.
|
knn.k |
Integer specifying the number of neighbors ( |
mcpls |
Should the model be estimated using the Monte-Carlo Consistent Partial Least Squares (MC-PLSc) algorithm? |
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. |
boot.ncores |
Integer: number of workers to be used for parallel bootstrapping.
Parallel bootstrapping is enabled when |
boot.ncpus |
Deprecated alias for |
boot.parallel |
The type of parallel operation to be used (if any). The
default is |
boot.R |
Integer giving the number of bootstrap resamples drawn when
|
boot.iseed |
An integer to set the bootstrap seed. Or |
sample |
DEPRECATED. Integer giving the number of bootstrap resamples drawn when
|
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.fixed.seed |
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. |
mc.polyak.juditsky |
Should the polyak.juditsky running average method be applied in the MC-PLS algorithm? |
mc.pj.extrapolate |
Logical; if |
mc.tol |
Tolerance in MC-PLS algorithm. |
mc.delta.se |
Should delta-method standard errors be computed for MC-PLS estimates? |
mc.delta.jacobian.k |
Integer number of Monte-Carlo Jacobians to average when computing delta-method standard errors. Defaults to one per 100 bootstrap resamples, with a minimum of 1. |
mc.fn.args |
Additional arguments to MC-PLS algorithm, mainly for controlling the step size. |
mc.rescov |
How residual covariances are treated in MC-PLS. One of
|
mc.diag.secant |
Logical; if |
mc.small.sample |
Logical; if |
mc.small.sample.max.k |
Maximum number of simulated samples to average
when |
mc.small.sample.point.estimate |
Which point estimate of the simulated
auxiliary parameters the root equation matches to the observed ones, when
The median commutes with the (monotone) binding function where the mean
does not, so median-matching targets a median-unbiased estimator. This
removes the finite-sample bias. which can be introduced by the curvature
size models, and when the indicators are uninformative (small loadings,
few categories, strongly assymetric thresholds). It makes the estimating
function somewhat noisier for a given number of simulated samples.
Ignored when |
verbose |
Should verbose output be printed? |
boot.optimize |
Logical; if |
boot.drop.inadmissible |
Logical; if |
mc.boot.control |
List of control parameters passed to the MC-PLS algorithm
inside each bootstrap replicate when |
reliabilities |
Optional named numeric vector of user-supplied reliabilities used for the PLSc consistency correction. |
default.path.estimator |
Character string selecting the estimator used for
the structural (path) model when the model does not require Generalized Least
Squares (GLS), or Linear Mixed-Effects Regression (LMER).
The default |
cluster |
Optional character vector naming the cluster variable(s) in
|
inner.weights |
Character string selecting the inner weighting scheme
used with |
approach.weights |
Character string selecting the approach used to
estimate the outer weights. |
mlm |
Should the model be estimated as a two-level (multilevel) model?
If |
level2.cov |
Two-level models only. How the (co-)variances of the
variables at level 2 are computed. |
level2.approach.weights |
Two-level models only. The approach used to
estimate the outer weights of the level 2 model ( |
... |
Internal arguments. For advanced users only. |
A PlsModel object containing the estimated parameters, fit measures,
factor scores, and any bootstrap results (a PlsMultilevelModel object
for two-level models). Methods such as summary(), coef(), and
parameter_estimates() can be applied to inspect the fit.
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)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)
Retrieve bootstrap coefficient matrix
pls_boot(object)pls_boot(object)
object |
A fitted model object. |
A PlsSemMatrix of bootstrap replicate parameter vectors
(rows = replicates, cols = parameters).
library(modsem) library(plssem) m <- " X =~ x1 + x2 + x3 Z =~ z1 + z2 + z3 Y =~ y1 + y2 + y3 Y ~ X + Z + X:Z " fit <- pls(m, oneInt, bootstrap = TRUE, boot.R = 50) pls_boot(fit)library(modsem) library(plssem) m <- " X =~ x1 + x2 + x3 Z =~ z1 + z2 + z3 Y =~ y1 + y2 + y3 Y ~ X + Z + X:Z " fit <- pls(m, oneInt, bootstrap = TRUE, boot.R = 50) pls_boot(fit)
Compute Chi-Square value for a PLS model.
pls_chisq(object, saturated = FALSE, mc.reps = 1e+06, ...) ## S4 method for signature 'PlsModel' pls_chisq(object, saturated = FALSE, mc.reps = 1e+06, ...) ## S4 method for signature 'PlsModel' pls_chisq_df(object, saturated = FALSE, mc.reps = 1e+06, ...)pls_chisq(object, saturated = FALSE, mc.reps = 1e+06, ...) ## S4 method for signature 'PlsModel' pls_chisq(object, saturated = FALSE, mc.reps = 1e+06, ...) ## S4 method for signature 'PlsModel' pls_chisq_df(object, saturated = FALSE, mc.reps = 1e+06, ...)
object |
A fitted [PlsModel] object. |
saturated |
Logical; if 'TRUE', compute the saturated fit. |
mc.reps |
Integer; number of Monte Carlo resamples used for MC-PLSc fit. |
... |
Reserved for future extensions. |
Chi-Square value
Compute Chi-Square degrees of freedom for a PLS model.
pls_chisq_df(object, saturated = FALSE, mc.reps = 1e+06, ...)pls_chisq_df(object, saturated = FALSE, mc.reps = 1e+06, ...)
object |
A fitted [PlsModel] object. |
saturated |
Logical; if 'TRUE', compute the saturated fit. |
mc.reps |
Integer; number of Monte Carlo resamples used for MC-PLSc fit. |
... |
Reserved for future extensions. |
Chi-Square degrees of freedom
Convenience wrapper around [pls_predict()] returning only the predicted latent scores matrix.
pls_construct_scores(object, ...)pls_construct_scores(object, ...)
object |
A fitted |
... |
Passed to [pls_predict()]. |
A PlsSemMatrix of predicted latent scores.
Returns the implied construct correlation matrix for a fitted model.
pls_implied_construct_corr(object, saturated = FALSE, mc.reps = 1e+06, ...) ## S4 method for signature 'PlsModel' pls_implied_construct_corr(object, saturated = FALSE, mc.reps = 1e+06, ...)pls_implied_construct_corr(object, saturated = FALSE, mc.reps = 1e+06, ...) ## S4 method for signature 'PlsModel' pls_implied_construct_corr(object, saturated = FALSE, mc.reps = 1e+06, ...)
object |
A fitted [PlsModel] object. |
saturated |
Logical; if 'TRUE', return the saturated implied matrix. |
mc.reps |
Integer; number of Monte Carlo resamples used for MC-PLSc. |
... |
Reserved for future extensions. |
For higher-order models, this is computed for the combined model returned by [combinedModel()].
A [PlsSemMatrix].
Returns the implied indicator correlation matrix for a fitted model.
pls_implied_indicator_corr(object, saturated = FALSE, mc.reps = 1e+06, ...) ## S4 method for signature 'PlsModel' pls_implied_indicator_corr(object, saturated = FALSE, mc.reps = 1e+06, ...)pls_implied_indicator_corr(object, saturated = FALSE, mc.reps = 1e+06, ...) ## S4 method for signature 'PlsModel' pls_implied_indicator_corr(object, saturated = FALSE, mc.reps = 1e+06, ...)
object |
A fitted [PlsModel] object. |
saturated |
Logical; if 'TRUE', return the saturated implied matrix. |
mc.reps |
Integer; number of Monte Carlo resamples used for MC-PLSc. |
... |
Reserved for future extensions. |
For higher-order models, this is computed for the combined model returned by [combinedModel()].
A numeric matrix.
Returns the joint implied correlation matrix of the observed and latent variables for a fitted model.
pls_implied_joint_corr(object, saturated = FALSE, mc.reps = 1e+06, ...) ## S4 method for signature 'PlsModel' pls_implied_joint_corr(object, saturated = FALSE, mc.reps = 1e+06, ...)pls_implied_joint_corr(object, saturated = FALSE, mc.reps = 1e+06, ...) ## S4 method for signature 'PlsModel' pls_implied_joint_corr(object, saturated = FALSE, mc.reps = 1e+06, ...)
object |
A fitted [PlsModel] object. |
saturated |
Logical; if 'TRUE', return the saturated implied matrix. |
mc.reps |
Integer; number of Monte Carlo resamples used for MC-PLSc. |
... |
Reserved for future extensions. |
For higher-order models, this is computed for the combined model returned by [combinedModel()].
A [PlsSemMatrix].
Extract important information from a fitted PlsModel. The interface is
modelled after lavaan::lavInspect(): a single what argument
selects which piece of information to return.
pls_inspect(object, what = "estimates", ...) ## S4 method for signature 'PlsModel' pls_inspect(object, what = "estimates", ...)pls_inspect(object, what = "estimates", ...) ## S4 method for signature 'PlsModel' pls_inspect(object, what = "estimates", ...)
object |
A fitted |
what |
A single string selecting what to extract (case-insensitive);
defaults to
|
... |
Currently ignored. |
The requested information; the type depends on what (see above).
## Not run: fit <- pls(model, data = data) pls_inspect(fit, "info") pls_inspect(fit, "cov.lv") ## End(Not run)## Not run: fit <- pls(model, data = data) pls_inspect(fit, "info") pls_inspect(fit, "cov.lv") ## End(Not run)
Predict from a fitted PLS-SEM model
pls_predict(object, ...) ## S4 method for signature 'PlsModel' pls_predict( object, approach = c("earliest", "direct"), newdata = NULL, std.ord.exp = FALSE, benchmark = "R2", benchmark.vars = c("endog", "exog", "all"), ... )pls_predict(object, ...) ## S4 method for signature 'PlsModel' pls_predict( object, approach = c("earliest", "direct"), newdata = NULL, std.ord.exp = FALSE, benchmark = "R2", benchmark.vars = c("endog", "exog", "all"), ... )
object |
A fitted |
... |
Additional arguments passed to internal helpers. |
approach |
Prediction approach. If |
newdata |
Optional new data matrix/data frame. |
std.ord.exp |
Logical; standardize ordinal expectation scores. |
benchmark |
Benchmark type(s). Either length 1 (recycled) or one entry
per indicator (optionally named). Supported: |
benchmark.vars |
What predictions should be benchmarked? If |
A PlsSemPredict object with matrices and benchmark results.
Compute RMSEA for a PLS model.
pls_rmsea(object, saturated = FALSE, mc.reps = 1e+06, ...) ## S4 method for signature 'PlsModel' pls_rmsea(object, saturated = FALSE, mc.reps = 1e+06, ...)pls_rmsea(object, saturated = FALSE, mc.reps = 1e+06, ...) ## S4 method for signature 'PlsModel' pls_rmsea(object, saturated = FALSE, mc.reps = 1e+06, ...)
object |
A fitted [PlsModel] object. |
saturated |
Logical; if 'TRUE', compute the saturated fit. |
mc.reps |
Integer; number of Monte Carlo resamples used for MC-PLSc fit. |
... |
Reserved for future extensions. |
RMSEA value
Compute SRMR for a PLS model.
pls_srmr(object, saturated = FALSE, mc.reps = 1e+06, ...) ## S4 method for signature 'PlsModel' pls_srmr(object, saturated = FALSE, mc.reps = 1e+06, ...)pls_srmr(object, saturated = FALSE, mc.reps = 1e+06, ...) ## S4 method for signature 'PlsModel' pls_srmr(object, saturated = FALSE, mc.reps = 1e+06, ...)
object |
A fitted [PlsModel] object. |
saturated |
Logical; if 'TRUE', compute the saturated fit. |
mc.reps |
Integer; number of Monte Carlo resamples used for MC-PLSc fit. |
... |
Reserved for future extensions. |
SRMR value
PlsModel (alias for pls_predict)Predict from a fitted PlsModel (alias for pls_predict)
## S4 method for signature 'PlsModel' predict(object, newdata = NULL, ...)## S4 method for signature 'PlsModel' predict(object, newdata = NULL, ...)
object |
A fitted |
newdata |
Optional new data matrix/data frame. |
... |
Further arguments passed to |
A PlsSemPredict object.
PlsSemPredict objectPrint a PlsSemPredict object
## S3 method for class 'PlsSemPredict' print(x, ...)## S3 method for class 'PlsSemPredict' print(x, ...)
x |
A |
... |
Additional arguments for compatibility with the generic. |
The input object, invisibly.
SummaryPlsMultilevel objectPrint a SummaryPlsMultilevel object
## S3 method for class 'SummaryPlsMultilevel' print(x, ...)## S3 method for class 'SummaryPlsMultilevel' print(x, ...)
x |
A |
... |
Additional arguments for compatibility with the generic. |
The input object, invisibly.
SummaryPlsSem objectPrint a SummaryPlsSem object
## S3 method for class 'SummaryPlsSem' print(x, ...)## S3 method for class 'SummaryPlsSem' print(x, ...)
x |
A |
... |
Additional arguments for compatibility with the generic. |
The input object, invisibly.
A simulated dataset.
syntax <- ' f =~ y1 + y2 + y3 f ~ rv(s1)*x1 + rv(s2)*x2 + x3 ' fit <- pls(syntax, data = randomSlopes, cluster = "cluster") summary(fit)syntax <- ' f =~ y1 + y2 + y3 f ~ rv(s1)*x1 + rv(s2)*x2 + x3 ' fit <- pls(syntax, data = randomSlopes, cluster = "cluster") summary(fit)
A simulated dataset.
syntax <- ' f =~ y1 + y2 + y3 f ~ rv(s1)*x1 + rv(s2)*x2 + x3 ' fit <- pls(syntax, data = randomSlopesOrdered, cluster = "cluster") summary(fit)syntax <- ' f =~ y1 + y2 + y3 f ~ rv(s1)*x1 + rv(s2)*x2 + x3 ' fit <- pls(syntax, data = randomSlopesOrdered, cluster = "cluster") summary(fit)
PlsModel objectCalled automatically when an object is printed at the prompt. Displays the package version, iteration count, and the parameter table.
## S4 method for signature 'PlsModel' show(object)## S4 method for signature 'PlsModel' show(object)
object |
A |
object, invisibly.
PlsMultilevelModel objectShow a PlsMultilevelModel object
## S4 method for signature 'PlsMultilevelModel' show(object)## S4 method for signature 'PlsMultilevelModel' show(object)
object |
A |
object, invisibly.
PlsModel modelSummarize a fitted PlsModel model
## S4 method for signature 'PlsModel' summary(object, fit = TRUE, unstandardized = FALSE, ci = FALSE, ...)## S4 method for signature 'PlsModel' summary(object, fit = TRUE, unstandardized = FALSE, ci = FALSE, ...)
object |
A |
fit |
Logical; Whether to compute fit measures. |
unstandardized |
Logical; Should unstandardized estiamtes be included? |
ci |
Logical; Should confidence intervals for parameter estimates be included? |
... |
Arguments passes to |
A SummaryPlsSem list with formatted results.
PlsMultilevelModel modelSummarize a fitted PlsMultilevelModel model
## S4 method for signature 'PlsMultilevelModel' summary(object, fit = TRUE, unstandardized = FALSE, ci = FALSE, ...)## S4 method for signature 'PlsMultilevelModel' summary(object, fit = TRUE, unstandardized = FALSE, ci = FALSE, ...)
object |
A |
fit |
Logical; Whether to compute fit measures (for each level). |
unstandardized |
Logical; Should unstandardized estimates be included? |
ci |
Logical; Should confidence intervals for parameter estimates be included? |
... |
Arguments passed to |
A SummaryPlsMultilevel list with formatted results.
This dataset has been re-packaged for convenience from https://github.com/paulhendricks/titanic
Passenger ID
Passenger Survival Indicator
Passenger Class
Name
Sex
Age
Number of Siblings/Spouses Aboard
Number of Parents/Children Aboard
Ticket Number
Passenger Fare
Cabin
Port of Embarkation
Dummy variable for Sex="female"
A data frame with 1309 rows and 12 variables:
https://www.kaggle.com/c/titanic/data
fit <- pls("Survived ~ Age + Female + Age:Female", data = titanic, ordered = "Survived") pls_predict(fit, benchmark = "acc")fit <- pls("Survived ~ Age + Female + Age:Female", data = titanic, ordered = "Survived") pls_predict(fit, benchmark = "acc")
A simulated dataset.
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) summary(fit)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) summary(fit)
Transform parameter estimates from a fitted PLS-SEM model to observed- and
latent-variable scales. Variables not selected through unstandardized
remain on their standardized scales.
unstandardized_estimates( model, unstandardized = "all", se = c("delta", "none"), scale.uncertainty = FALSE, eps = 1e-04, zero.tol = 1e-10, rm.tmp.ov = TRUE, clean.tmp.ind = TRUE, clean.tmp.mimic = TRUE ) ## S4 method for signature 'PlsModel' unstandardized_estimates( model, unstandardized = "all", se = c("delta", "none"), scale.uncertainty = FALSE, eps = 1e-04, zero.tol = 1e-10, rm.tmp.ov = TRUE, clean.tmp.ind = TRUE, clean.tmp.mimic = TRUE )unstandardized_estimates( model, unstandardized = "all", se = c("delta", "none"), scale.uncertainty = FALSE, eps = 1e-04, zero.tol = 1e-10, rm.tmp.ov = TRUE, clean.tmp.ind = TRUE, clean.tmp.mimic = TRUE ) ## S4 method for signature 'PlsModel' unstandardized_estimates( model, unstandardized = "all", se = c("delta", "none"), scale.uncertainty = FALSE, eps = 1e-04, zero.tol = 1e-10, rm.tmp.ov = TRUE, clean.tmp.ind = TRUE, clean.tmp.mimic = TRUE )
model |
A fitted |
unstandardized |
Character vector naming variables to unstandardize, or
one of |
se |
Character string selecting delta-method standard errors
( |
scale.uncertainty |
Should scale uncertainty be included?
defaults to |
eps |
Positive numeric finite-difference step used for the delta-method Jacobian. |
zero.tol |
Non-negative numeric tolerance below which standard errors are returned as missing. |
rm.tmp.ov |
Logical; whether rows involving temporary observed variables should be removed from the returned parameter table. |
clean.tmp.ind |
Logical; whether rows involving temporary indicators should be cleaned from the returned parameter table. |
clean.tmp.mimic |
Logical; whether rows involving temporary mimic indicators should be cleaned from the returned parameter table. |
A PlsSemParTable containing transformed estimates and (when
requested) delta-method standard errors. The transformed covariance matrix
is stored in the "vcov" attribute.
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 + INT:PBC ' fit <- pls(tpb, modsem::TPB, bootstrap = TRUE, boot.R = 50) unstandardized_estimates(fit)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 + INT:PBC ' fit <- pls(tpb, modsem::TPB, bootstrap = TRUE, boot.R = 50) unstandardized_estimates(fit)
PlsMultilevelModel objectsComputes the unstandardized estimates of each level of a two-level model.
## S4 method for signature 'PlsMultilevelModel' unstandardized_estimates( model, unstandardized = "all", se = c("delta", "none"), scale.uncertainty = FALSE, eps = 1e-04, zero.tol = 1e-10, rm.tmp.ov = TRUE, clean.tmp.ind = TRUE, clean.tmp.mimic = TRUE )## S4 method for signature 'PlsMultilevelModel' unstandardized_estimates( model, unstandardized = "all", se = c("delta", "none"), scale.uncertainty = FALSE, eps = 1e-04, zero.tol = 1e-10, rm.tmp.ov = TRUE, clean.tmp.ind = TRUE, clean.tmp.mimic = TRUE )
model |
A fitted |
unstandardized |
Character vector naming variables to unstandardize, or
one of |
se |
Character string selecting delta-method standard errors
( |
scale.uncertainty |
Should scale uncertainty be included?
defaults to |
eps |
Positive numeric finite-difference step used for the delta-method Jacobian. |
zero.tol |
Non-negative numeric tolerance below which standard errors are returned as missing. |
rm.tmp.ov |
Logical; whether rows involving temporary observed variables should be removed from the returned parameter table. |
clean.tmp.ind |
Logical; whether rows involving temporary indicators should be cleaned from the returned parameter table. |
clean.tmp.mimic |
Logical; whether rows involving temporary mimic indicators should be cleaned from the returned parameter table. |
The levels are unstandardized separately, using the (decomposed) scales of
the variables at each level, i.e., sqrt(1 - icc) * sd at level 1, and
sqrt(icc) * sd at level 2 for variables at both levels. The latent
variables are scaled by their first indicators. The scales of the random
slopes (y ~ rv(s) * x) are rsd * sd(y) / sd(x), where
sd(y) and sd(x) are the scales of y and x at
level 1. For ordered variables, the latent responses are scaled such that
their (total) residual variances are 1, i.e.,
(1 - icc) * theta_W + icc * theta_B = 1, where theta_W and
theta_B are the standardized residual variances at each level. The
thresholds are rescaled accordingly.
A PlsSemParTable data frame, with a level column.
PlsModel modelExtract the variance-covariance matrix from a PlsModel model
## S4 method for signature 'PlsModel' vcov(object, use.labels = TRUE, ...)## S4 method for signature 'PlsModel' vcov(object, use.labels = TRUE, ...)
object |
A |
use.labels |
Logical; Should parameter labels be used as names? |
... |
Currently unused. |
A PlsSemMatrix (bootstrap-based vcov, or NULL).
PlsMultilevelModel modelDelta-method (co-)variances, see the bootstrap argument of mpls().
Parameters at the between level (level 2) are suffixed with .l2.
## S4 method for signature 'PlsMultilevelModel' vcov(object, ...)## S4 method for signature 'PlsMultilevelModel' vcov(object, ...)
object |
A |
... |
Currently unused. |
A PlsSemMatrix, or NULL if no standard errors were computed.