predict.matrixpls: Predict method for matrixpls results

Description Usage Arguments Value References See Also Examples

View source: R/matrixpls.predict.R

Description

The matrixpls method for the generic function predict predict. Predicts the reflective indicators of endogenous latent variables using estimated model and data for the indicators of exogenous latent variables

Usage

1
2
3
4
5
6
7
8
## S3 method for class 'matrixpls'
predict(
  object,
  newData,
  predictionType = c("exogenous", "redundancy", "communality", "composites"),
  means = NULL,
  ...
)

Arguments

object

matrixpls estimation result object produced by the matrixpls function.

newData

A data frame or a matrix containing data used for prediction.

predictionType

"exogenous" (default) predicts indicators from exogenous composites. "redundancy" and "communality" are alternative strategies described by Chin (2010). "composites" returns the composites calculated by multiplying the data with the weight matrix.

means

A vector of means of the original data used to calculate intercepts for the linear prediction equations. If not provided, calculated from the new data or assumed zero.

...

All other arguments are ignored.

Value

a matrix of predicted values for reflective indicators of endogenous latent variables or weighted composites of the indicators.

References

Wold, H. (1974). Causal flows with latent variables: Partings of the ways in the light of NIPALS modeling. European Economic Review, 5(1), 67–86. doi: 10.1016/0014-2921(74)90008-7

Chin, W. W. (2010). How to write up and report PLS analyses. In V. Esposito Vinzi, W. W. Chin, J. Henseler, & H. Wang (Eds.), Handbook of partial least squares (pp. 655–690). Berlin Heidelberg: Springer.

See Also

Other post-estimation functions: ave(), cei(), cr(), effects.matrixpls(), fitSummary(), fitted.matrixpls(), gof(), htmt(), loadings(), r2(), residuals.matrixpls()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Run the customer satisfaction example form plspm

# 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)
inner = rbind(IMAG, EXPE, QUAL, VAL, SAT, LOY)
colnames(inner) <- rownames(inner)

# Reflective model

reflective<- matrix(
  c(1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1),
  27,6, dimnames = list(colnames(satisfaction)[1:27],colnames(inner)))

# empty formative model

formative <- matrix(0, 6, 27, dimnames = list(colnames(inner),
                                              colnames(satisfaction)[1:27]))

satisfaction.model <- list(inner = inner,
                           reflective = reflective,
                           formative = formative)

# Estimation using covariance matrix


satisfaction.out <- matrixpls(cov(satisfaction[,1:27]),
                           model = satisfaction.model)

print(satisfaction.out)



# Predict indicators using means from the data
predict(satisfaction.out, 
        newData = satisfaction,
        means= sapply(satisfaction, mean))

# Calculate composite scores
predict(satisfaction.out, 
        newData = satisfaction,
        predictionType = "composites")

matrixpls documentation built on April 28, 2021, 5:07 p.m.