## example of rebus analysis with simulated data
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
## run rebus.pls function on the sim.data and choose the number of classes
## to be taken into account according to the displayed dendrogram.
rebus.sim <- rebus.pls(sim.global, 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)
##
## ONCE COMPUTED THE GLOBAL MODEL IT IS POSSIBLE TO OBTAIN THE SAME RESULTS AS THE ONES
## OBTAINED BY RUNNING rebus.pls FUNCTION BY RUNNING THE FUNCTION res.clus
## AND THEN THE FUNCTION it.reb.
##
## Example:
## Once the global model is calculated you need to perform cluster analysis on residuals of the global model:
sim.res.clus <- res.clus(sim.global)
## and then run the iteration algorithm:
rebus.sim.twofunc <- it.reb(sim.global, sim.res.clus, nk=2,
stop.crit=0.005, iter.max=100)
##
## rebus.sim = rebus.sim.twofunc
Run the code above in your browser using DataLab