## example of PLS-PM in ecological analysis
## model with three LVs and formative indicators
data(arizona)
ari.mat <- matrix(c(0,0,0,0,0,0,1,1,0),3,3,byrow=TRUE)
dimnames(ari.mat) <- list(c("ENV","SOIL","DIV"),c("ENV","SOIL","DIV"))
ari.sets <- list(c(1,2),c(3,4,5),c(6,7,8))
ari.mod <- c("B","B","B") ## formative indicators
res1 <- plspm(arizona, inner.mat=ari.mat, sets=ari.sets, modes=ari.mod,
scheme="factor", scaled=TRUE, plsr=TRUE)
res1
summary(res1)
## typical example of PLS-PM in customer satisfaction analysis
## model with six LVs and reflective indicators
data(satisfaction)
IMAG <- c(0,0,0,0,0,0)
EXPE <- c(1,0,0,0,0,0)
QUAL <- c(1,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.mat <- rbind(IMAG, EXPE, QUAL, VAL, SAT, LOY)
sat.sets <- list(1:5,6:10,11:15,16:19,20:23,24:27)
sat.mod <- rep("A",6) ## reflective indicators
res2 <- plspm(satisfaction, sat.mat, sat.sets, sat.mod, scheme="factor",
scaled=FALSE)
summary(res2)
## example of PLS-PM in sensory analysis
## estimate a path model for the orange juice data
data(orange)
senso.mat <- matrix(c(0,0,0,1,0,0,1,1,0),3,3,byrow=TRUE)
dimnames(senso.mat) <- list(c("PHYCHEM","SENSORY","HEDONIC"),
c("PHYCHEM","SENSORY","HEDONIC"))
senso.sets <- list(1:9,10:16,17:112)
senso.mod <- rep("A",3)
res3 <- plspm(orange, senso.mat, senso.sets, senso.mod,
scheme="centroid", scaled=TRUE, boot.val=FALSE)
## example of PLS-PM in multi-block data analysis
## estimate a path model for the wine data set
## requires package FactoMineR
library(FactoMineR)
data(wine)
SMELL <- c(0,0,0,0)
VIEW <- c(1,0,0,0)
SHAKE <- c(1,1,0,0)
TASTE <- c(1,1,1,0)
wine.mat <- rbind(SMELL,VIEW,SHAKE,TASTE)
wine.sets <- list(3:7,8:10,11:20,21:29)
wine.mods <- rep("A",4)
scheme <- "centroid"
scaled <- FALSE
boot.val <- FALSE
res4 <- plspm(wine, wine.mat, wine.sets, wine.mods, scheme="centroid")
Run the code above in your browser using DataLab