Description Usage Arguments Details Value Note Author(s) See Also Examples
Calculates PLS-PM for global and local models from a given partition
1 | local.models(pls, y, Y = NULL)
|
pls |
An object of class |
y |
One object of the following classes:
|
Y |
Optional dataset (matrix or data frame) used
when argument |
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",
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.
An object of class "local.models", basically a
list of length k+1, where k is the number
of classes.
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.
Laura Trinchera, Gaston Sanchez
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 | ## Example of REBUS PLS with simulated data
# load simdata
data(simdata, package="plspm2")
# Calculate global plspm
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(simdata, sim_inner,
sim_outer, modes=sim_mod)
sim_global
## Then compute cluster analysis on residuals of global model
sim_clus = res.clus(sim_global)
## To complete REBUS, run iterative algorithm
rebus_sim = it.reb(sim_global, sim_clus, nk=2,
stop.crit=0.005, iter.max=100)
## You can also compute complete outputs
## for local models by running:
local_rebus = local.models(sim_global, rebus_sim)
# Display plspm summary for first local model
summary(local_rebus$loc.model.1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.