Learn R Programming

matrixpls (version 0.7.0)

matrixpls.plspm: A plspm compatibility wrapper for matrixpls

Description

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

Usage

matrixpls.plspm(Data, path_matrix, blocks, modes = NULL,
  scheme = "centroid", scaled = TRUE, tol = 1e-06, maxiter = 100,
  boot.val = FALSE, br = NULL, dataset = TRUE)

Arguments

Data
matrix or data frame containing the manifest variables.
path_matrix
A square (lower triangular) boolean matrix representing the inner model (i.e. the path relationships between latent variables).
blocks
list of vectors with column indices or column names from Data indicating the sets of manifest variables forming each block (i.e. which manifest variables correspond to each block).
modes
character vector indicating the type of measurement for each block. Possible values are: "A", "B", "newA", "PLScore", "PLScow". The length of modes must be equal to the length of blocks.
scheme
string indicating the type of inner weighting scheme. Possible values are "centroid", "factorial", or "path".
scaled
whether manifest variables should be standardized. Only used when scaling = NULL. When (TRUE, data is scaled to standardized values (mean=0 and variance=1). The variance is calculated dividing by N instead of
tol
decimal value indicating the tolerance criterion for the iterations (tol=0.000001). Can be specified between 0 and 0.001.
maxiter
integer indicating the maximum number of iterations (maxiter=100 by default). The minimum value of maxiter is 100.
boot.val
whether bootstrap validation should be performed. (FALSE by default).
br
number bootstrap resamples. Used only when boot.val=TRUE. When boot.val=TRUE, the default number of re-samples is 100.
dataset
whether the data matrix used in the computations should be retrieved (TRUE by default).

Value

  • An object of class plspm.

Details

The function matrixpls.plspm calculates indicator weights and estimates a model identically to the plspm function. In contrast to the matrixpls function that provides only weights and parameter estimates, this function also reports multiple post-estimation statistics. Because of this matrixpls.plspm is substantially less efficient than the matrixpls function.

The argument path_matrix is a matrix of zeros and ones that indicates the structural relationships between composites. This must be a lower triangular matrix. path_matrix will contain a 1 when column j affects row i, 0 otherwise.

References

Sanchez, G. (2013). PLS Path Modeling with R. Retrieved from http://www.gastonsanchez.com/PLS Path Modeling with R.pdf

See Also

plspm

Examples

Run this code
if(!require(plspm)){
    print("This example requires the plspm package")
} else{
cores <- getOption("mc.cores")
options(mc.cores=2)

# Run the example from plspm package

# load dataset satisfaction
data(satisfaction)
# inner model matrix
IMAG = c(0,0,0,0,0,0)
EXPE = c(1,0,0,0,0,0)
QUAL = c(0,1,0,0,0,0)
VAL = c(0,1,1,0,0,0)
SAT = c(1,1,1,1,0,0)
LOY = c(1,0,0,0,1,0)
sat_inner = rbind(IMAG, EXPE, QUAL, VAL, SAT, LOY)
# outer model list
sat_outer = list(1:5, 6:10, 11:15, 16:19, 20:23, 24:27)
# vector of modes (reflective indicators)
sat_mod = rep("A", 6)

# apply plspm
plspm.res <- plspm(satisfaction, sat_inner, sat_outer, sat_mod,
                   scaled=FALSE, boot.val=FALSE)

# apply matrixpls
matrixpls.res <- matrixpls.plspm(satisfaction, sat_inner, sat_outer, sat_mod,
                                 scaled=FALSE, boot.val=FALSE)

# If RUnit is installed check that the results are identical

if(is.element("RUnit", installed.packages()[,1])){
  library(RUnit)
  checkEquals(plspm.res, matrixpls.res, tol = 0.001)
}

# print the resuls

print(summary(plspm.res))
print(summary(matrixpls.res))

options(mc.cores=cores)

}

Run the code above in your browser using DataLab