Learn R Programming

plspm (version 0.2-2)

local.models: Calculates PLS-PM for global and local models

Description

Calculates PLS-PM for global and local models from a given partition.

Usage

local.models(pls, y, Y=NULL)

Arguments

pls
An object of class "plspm"
y
One object of the following classes: "rebus", "integer", or "factor", that provides the class partitions.
Y
Optional dataset (matrix or data frame) used when argument dataset=NULL inside pls.

Value

  • 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.modelPLS-PM of the global model
  • loc.model.1PLS-PM of segment (class) 1
  • loc.model.2PLS-PM of segment (class) 2
  • loc.model.kPLS-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.

Details

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). When the object pls does not contain a data matrix (i.e. pls$data=NULL), the user must provide the data matrix or data frame in Y. The original parameters modes, scheme, scaled, tol, and iter from the object pls are taken.

See Also

rebus.pls

Examples

Run this code
## example of rebus analysis
  data(sim.data)
  ## First compute GLOBAL model
  sim.inner <- matrix(c(0,0,0,0,0,0,1,1,0),3,3,byrow=TRUE)
  dimnames(sim.inner) <- list(c("Price","Quality","Satisfaction"),
                            c("Price","Quality","Satisfaction"))
  sim.outer <- 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=sim.inner, 
                      outer=sim.outer, 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)

Run the code above in your browser using DataLab