| local.models {plspm} | R Documentation |
Calculates PLS-PM for global and local models from a given partition.
local.models(pls, y, scheme=NULL, scaled=NULL, boot.val=FALSE, br=NULL)
pls |
An object of class "plspm" |
y |
One object of the following classes: "rebus", "integer", or "factor", that provides the class partitions. |
scheme |
Possible values are "centroid", "factor" and "path". |
scaled |
A logical value indicating whether scaling data is performed. |
boot.val |
A logical value indicating whether bootstrap validation is performed (FALSE by default). |
br |
An integer indicating the number bootstrap resamples. Used only when boot.val=TRUE. |
The function local.models calculates PLS-PM for the global model (i.e. over all observations) as well as PLS-PM for local models (i.e. observations of different partitions).
When y is an object of class "rebus", the function local.models is applied to the classes obtained from the REBUS algorithm.
When y is an integer vector or a factor, the values or levels are assumed to represent the group to which each observation belongs. In this case, the function local.models calculates PLS-PM for the global model, as well as PLS-PM for each group (local models).
If scheme=NULL, then the original scheme from the object pls will be taken.
If scaled=NULL, then the original scaled from the object pls will be taken.
When bootstrap validation is performed, the default number of re-samples is 200. However, br can be specified in a range from 50 to 500.
An object of class "local.models", basically a list of length k+1, where k is the number of classes. The list contains the following elements:
glob.model |
PLS-PM of the global model |
loc.model.1 |
PLS-PM of segment (class) 1 |
loc.model.2 |
PLS-PM of segment (class) 2 |
loc.model.k |
PLS-PM of segment (class) k |
Each element of the list is an object of class "plspm". Thus, in order to examine the
results for each local model, it is necessary to use the summary function. See examples below.
Note that if scheme and/or scaled differ from the original arguments of pls, the results obtained in local.models will be different from those obtained in pls as well as in y (if it is of class "rebus").
Laura Trinchera, Gaston Sanchez
## Not run:
## example of rebus analysis
data(sim.data)
## First compute GLOBAL model
sim.mat <- matrix(c(0,0,0,0,0,0,1,1,0),3,3,byrow=TRUE)
dimnames(sim.mat) <- list(c("Price","Quality","Satisfaction"),
c("Price","Quality","Satisfaction"))
sim.sets <- list(c(1,2,3,4,5),c(6,7,8,9,10),c(11,12,13))
sim.mod <- c("A","A","A") ## reflective indicators
sim.global <- plspm(sim.data, inner.mat=sim.mat,
sets=sim.sets, modes=sim.mod)
sim.global
## Then compute cluster on residual from global model
sim.res.clus <- res.clus(sim.global)
## To conclude run iteration algorithm
rebus.sim <- it.reb(sim.global, sim.res.clus, nk=2,
stop.crit = 0.005, iter.max = 100 )
## Computation of local models
local.rebus <- local.models(sim.global, rebus.sim)
## Display plspm summary for first local model
summary(local.rebus$loc.model.1)
## End(Not run)