Learn R Programming

matrixpls (version 0.7.0)

matrixpls.sempls: A semPLS compatibility wrapper for matrixpls

Description

matrixpls.sempls mimics sempls function of the semPLS package. The arguments and their default values and the output of the function are identical with sempls function, but internally the function uses matrixpls estimation.

Usage

matrixpls.sempls(model, data, maxit = 20, tol = 1e-07, scaled = TRUE,
  sum1 = FALSE, wscheme = "centroid", pairwise = FALSE,
  method = c("pearson", "kendall", "spearman"), convCrit = c("relative",
  "square"), verbose = TRUE, ...)

Arguments

model
An object inheriting from class plsm as returned from plsm or read.splsm.
data
A data.frame containing the observed variables (MVs). The storage mode for all the MVs included in the model must be numeric.
maxit
A numeric value, which determines the maximum number of iterations performed by the PLS algorithm. The default is $20$ iterations.
tol
A numeric value, specifying the tolerance for the maximum relative differences in the outer weights. The default value is $10^{-7}$.
scaled
A logical value indicating, whether the observed data shall be scaled to zero mean and unit variance. The default is TRUE.
sum1
A logical value indicating, whether the outer weights foreach latent variable (LV) shall be standardized to sum up to one. The default is FALSE. Since the factor scores are scaled in each step of the PLS algorithm, ch
wscheme
A character naming the weighting scheme to use. Possible values are:
  • "A"or"centroid"for the centroid scheme, the default,
  • "B"or"factorial"for the factorial scheme and
pairwise
A logical value indicating, whether correlations shall be calculated pairwise. If the observed data does not contain missing values, the results are not affected. The default is FALSE. For more details the R help,
method
A character naming the method to calculate the correlations. Possible values are:
  • "pearson", the default,
  • "kendall",
  • "spearman".
For more details on the met
convCrit
The convergence criteria to use:
  • "relative", the default,
  • "square".
verbose
Logical: If FALSE no status messages are printed.
...
Other arguments are ignored

Value

References

Monecke, A., & Leisch, F. (2012). semPLS: Structural Equation Modeling Using Partial Least Squares. Journal of Statistical Software, 48(3), 1–32.

See Also

sempls

Examples

Run this code
if(!require(semPLS)){
    print("This example requires the semPLS package")
} else{
data(ECSImobi)

ecsi.sempls <- sempls(model=ECSImobi, data=mobi, wscheme="pathWeighting")
ecsi <- matrixpls.sempls(model=ECSImobi, data=mobi, wscheme="pathWeighting")

# If RUnit is installed check that the results are identical

if(require(RUnit)){
  checkEquals(ecsi.sempls,ecsi, check.attributes = FALSE)
}

ecsi

## create plots
densityplot(ecsi)
densityplot(ecsi, use="prediction")
densityplot(ecsi, use="residuals")

## Values of 'sempls' objects
names(ecsi)
ecsi$outer_weights
ecsi$outer_loadings
ecsi$path_coefficients
ecsi$total_effects


### using convenience methods to sempls results
## path coefficients
pathCoeff(ecsi)

## total effects
totalEffects(ecsi)

## get loadings and check for discriminant validity
(l <- plsLoadings(ecsi))
# outer loadings
print(l, type="outer", digits=2)
# outer loadings greater than 0.5
print(l,type="outer", cutoff=0.5, digits=2)
# cross loadings greater than 0.5
print(l, type="cross", cutoff=0.5, digits=2)


### R-squared
rSquared(ecsi)

}

Run the code above in your browser using DataLab