plot.plstree {genpathmox} | R Documentation |
Plot function for the pathmox segmentation tree
Description
The function plot.plstree
allows to drow PATHMOX tree
Usage
## S3 method for class 'plstree'
plot(
x,
.root.col = "#CCFFFF",
.node.col = "#99CCCC",
.leaf.col = "#009999",
.shadow.size = 0.003,
.node.shadow = "#669999",
.leaf.shadow = "#006666",
.cex = 0.7,
.seg.col = "#003333",
.lwd = 1,
.show.pval = TRUE,
.pval.col = "#009999",
.main = NULL,
.cex.main = 1,
...
)
Arguments
x |
An object of the class |
.root.col |
Fill color of root node. |
.node.col |
Fill color of child nodes. |
.leaf.col |
Fill color of leaf. |
.shadow.size |
Relative size of shadows. |
.node.shadow |
Color of shadow of child nodes. |
.leaf.shadow |
Color of shadow of leaf nodes. |
.cex |
A numerical value indicating the magnification to be used for plotting text. |
.seg.col |
The color to be used for the labels of the segmentation variables. |
.lwd |
The line width, a positive number, defaulting to 1. |
.show.pval |
Logical value indicating whether the p-values should be plotted. |
.pval.col |
The color to be used for the labels of the p-values. |
.main |
A main title for the plot. |
.cex.main |
The magnification to be used for the main title. |
... |
Further arguments passed on to |
Author(s)
Giuseppe Lamberti
References
Lamberti, G., Aluja, T. B., and Sanchez, G. (2016). The Pathmox approach for PLS path modeling segmentation. Applied Stochastic Models in Business and Industry, 32(4), 453-468. doi: 10.1002/asmb.2168
Lamberti, G. (2015). Modeling with Heterogeneity, PhD Dissertation.
Sanchez, G. (2009). PATHMOX Approach: Segmentation Trees in Partial Least Squares Path Modeling, PhD Dissertation.
See Also
summary.plstree
, print.plstree
, pls.pathmox
,
bar_terminal
, and bar_impvar
Examples
## Not run:
# Example of PATHMOX approach in customer satisfaction analysis
# (Spanish financial company).
# Model with 5 LVs (4 common factor: Image (IMAG), Value (VAL),
# Satisfaction (SAT), and Loyalty (LOY); and 1 composite construct:
# Quality (QUAL)
# load library and dataset csibank
library(genpathmx)
data("csibank")
# Define the model using the lavaan syntax. Use a set of regression formulas to define
# first the structural model and then the measurement model
CSImodel <- "
# Structural model
VAL ~ QUAL
SAT ~ IMAG + QUAL + VAL
LOY ~ IMAG + SAT
# Measurement model
# Composite
QUAL <~ qual1 + qual2 + qual3 + qual4 + qual5 + qual6 + qual7
# Common factor
IMAG =~ imag1 + imag2 + imag3 + imag4 + imag5 + imag6
VAL =~ val1 + val2 + val3 + val4
SAT =~ sat1 + sat2 + sat3
LOY =~ loy1 + loy2 + loy3
"
# Identify the categorical variable to be used as input variables
in the split process
CSIcatvar = csibank[,1:5]
# Check if variables are well specified (they have to be factors
# and/or ordered factors)
str(CSIcatvar)
# Transform age and education into ordered factors
CSIcatvar$Age = factor(CSIcatvar$Age, levels = c("<=25",
"26-35", "36-45", "46-55",
"56-65", ">=66"),ordered = T)
CSIcatvar$Education = factor(CSIcatvar$Education,
levels = c("Unfinished","Elementary", "Highschool",
"Undergrad", "Graduated"),ordered = T)
# Run Pathmox analysis (Lamberti et al., 2016; 2017)
csi.pathmox = pls.pathmox(
.model = CSImodel ,
.data = csibank,
.catvar= CSIcatvar,
.alpha = 0.05,
.deep = 2
)
Visualize the tree
plot(csi.pathmox)
## End(Not run)