Title: | Pathmox Approach Segmentation Tree Analysis |
Version: | 1.1 |
Description: | It provides an interesting solution for handling a high number of segmentation variables in partial least squares structural equation modeling. The package implements the "Pathmox" algorithm (Lamberti, Sanchez, and Aluja,(2016)<doi:10.1002/asmb.2168>) including the F-coefficient test (Lamberti, Sanchez, and Aluja,(2017)<doi:10.1002/asmb.2270>) to detect the path coefficients responsible for the identified differences). The package also allows running the hybrid multi-group approach (Lamberti (2021) <doi:10.1007/s11135-021-01096-9>). |
Depends: | R (≥ 3.5.0), stats, cSEM, diagram, methods, graphics, grDevices, matrixcalc |
License: | GPL-3 |
LazyData: | true |
Encoding: | UTF-8 |
RoxygenNote: | 7.1.1 |
NeedsCompilation: | no |
Packaged: | 2023-10-26 08:58:56 UTC; giuseppelamberti |
Author: | Giuseppe Lamberti [aut, cre] |
Maintainer: | Giuseppe Lamberti <giuseppelamb@hotmail.com> |
Repository: | CRAN |
Date/Publication: | 2023-10-26 09:20:03 UTC |
Path coefficient extraction
Description
############################################################################################
Usage
.path(x, l)
Arguments
x |
matrix containing path coefficients |
Details
Internal function
Value
a vector of path coefficients
Data preprocessing for F-tests
Description
############################################################################################
Usage
F.data(x, inner, .model, .scheme, .consistent, modtwo)
Arguments
x |
matrix or dataframe containing the data. |
inner |
a square (lower triangular) boolean matrix representing the inner model. |
.model |
A description of the user-specified model. |
.scheme |
string indicating the type of inner weighting
scheme. Possible values are |
.consistent |
Logical. Should composite/proxy correlations be disattenuated to yield consistent loadings and path estimates if at least one of the construct is modeled as a common factor. Defaults to TRUE. |
modtwo |
vector indicating the binary partition. |
Details
Internal function
Value
list containing matrices needed for the tests.
F-coefficient test
Description
############################################################################################
Usage
Fc.test(Y1, X1, path.name, info.block)
Arguments
Y1 |
vector of the concatenate indipendent latent variables of H1 hypothesis of the F-coefficient test. |
X1 |
matrix of the concatenate predictor latent variables of H1 hypothesis of the F-coefficient test. |
path.name |
vector of path coefficients labels. |
info.block |
list contaning information about the endogenous equations of the pls model. |
Details
Internal function
Value
a list containing the statistic and the p-value obtained by applying the F-coefficient. test
F-global test
Description
############################################################################################
Usage
Fg.test(Y0, X0, Y1, X1)
Arguments
Y0 |
vector of the concatenate indipendent latent variables of H0 hypothesis global test |
X0 |
matrix of the concatenate predictor latent variables of H0 hypothesis global test |
Y1 |
vector of the concatenate indipendent latent variables of H1 hypothesis global test |
X1 |
matrix of the concatenate predictor latent variables of H1 hypothesis global test |
Details
Internal function
Value
a list containing the statistic and the p-value obtained by applying F-global test
Candidates to the bets partition for each of segmentation variables
Description
############################################################################################
Usage
all_part(x, y, inner, .model, .scheme, .consistent, size_candidate, ...)
Arguments
x |
matrix or dataframe containing the dataset. |
y |
matrix or dataframe or vector of the segmentation variables |
inner |
a square (lower triangular) boolean matrix representing the inner model (i.e. the path relationships between latent variables) |
.model |
A description of the user-specified model. |
.scheme |
string indicating the type of inner weighting
scheme. Possible values are |
.consistent |
Logical. Should composite/proxy correlations be disattenuated to yield consistent loadings and path estimates if at least one of the construct is modeled as a common factor. Defaults to TRUE. |
size_candidate |
number indicating the minimum threshold for a node. |
Details
Internal function
Value
a list containing information of the candidates to the optimum partition for each of segmentation variables
Bar Plot of a ranking of categorical variables by importance
Description
"bar_impvar"
returns a bar plot to visualize the ranking
of variables by importance in obtaining the terminal nodes of Pathmox.
Usage
bar_impvar(x, .cex.names = 1, .cex.axis = 1.2, .cex.main = 1, ...)
Arguments
x |
An object of the class |
.cex.names |
Expansion factor for axis names (bar labels) |
.cex.axis |
Expansion factor for numeric axis labels |
.cex.main |
Allows fixing the size of the main. Equal to 1 to default |
... |
Further arguments are ignored |
Details
The importance of each variable is determined by adding the F-statistic calculated for the variable in each split node of Pathmox.
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 plot.plstree
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
)
bar_impvar(csi.pathmox)
## End(Not run)
Comparative plot for the Pathmox terminal nodes
Description
bar_terminal
returns the path coefficient bar plots of the Pathmox terminal
nodes.
Usage
bar_terminal(
x,
.LV,
.bycoef = FALSE,
.cex.names = 1,
.cex.axis = 1.2,
.cex.main = 1,
...
)
Arguments
x |
An object of the class |
.LV |
A string indicating the name of the dependent latent variable. The label must be the same as used to define the structural model in the (lavaan syntax). |
.bycoef |
Logical value indicating if the comparison is done by nodes or by path
coefficients. By default, |
.cex.names |
Expansion factor for axis names (bar labels). |
.cex.axis |
Expansion factor for numeric axis labels. |
.cex.main |
Allows fixing the size of the main. It is equal to 1 to default. |
... |
Further arguments are ignored. |
Details
This function aims to visualize, using bar plots, the path coefficients of the dependnet latent construct associated with the terminal nodes. The user indicates the dependnet latent construct they want to visualize. This is done using the same label as used in the structural model definition (lavaan syntax). The comparison is done by analyzing the path coefficient values for each node, or the values estimated in each node for each path coefficient. In the former, the plot also returns the R^2. In the latter, the bar corresponding to the node with the highest path coefficient value shows in a different color. By default the comparison is done by analyzing the path coefficient values for each node.
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
,
plot.plstree
, 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
"
# Run pathmox on one single variable
age = csibank[,2]
# Transform age into an ordered factor
age = factor(age, levels = c("<=25", "26-35", "36-45", "46-55",
"56-65", ">=66"),ordered = T)
csi.pathmox.age = pls.pathmox(
.model = CSImodel ,
.data = csibank,
.catvar= age,
.alpha = 0.05,
.deep = 1
)
# Visualize the bar plot by comparing the nodes
bar_terminal(csi.pathmox.age, .LV = "SAT")
# Visualize the bar plot by comparing path coefficients
bar_terminal(csi.pathmox.age, .LV = "SAT", .bycoef = TRUE)
## End(Not run)
Labels of a categorical variable a binary partions
Description
############################################################################################
Usage
bin.levels(z, spl)
Arguments
z |
matrix containing the posible combination of levels of factor |
spl |
segmentation variables (factor) |
Details
Internal function
Value
a list of labels
Bart matrix
Description
############################################################################################
Usage
blockdiag(x, ...)
Arguments
x |
list of matrices used to build the Bart matrix |
... |
further arguments passed on to |
Details
Internal function
Value
the Bart matrix
Linear relations between latent variables.
Description
############################################################################################
Usage
build.block(inner, latent)
Arguments
inner |
a square (lower triangular) boolean matrix representing the inner model (i.e. the path relationships between latent variables) |
latent |
matrix of the latent score |
Details
Internal function.
Value
a list of matrices containing for each endogenous latent variable the the own predictors
Posibble partions for each node of the tree
Description
############################################################################################
Usage
candidates.tree(moxtree)
Arguments
moxtree |
class containing the moxtree elements |
Details
Internal function
Value
the Posibble partions for each node of the tree
Checks arguments
Description
############################################################################################
Usage
check_arg_mox(
.model,
.data,
.catvar,
.scheme,
.consistent,
.alpha,
.deep,
.size,
.size_candidate,
.tree
)
Arguments
.model |
a model in lavaan model syntax |
.data |
a data.frame or a matrix of indicators |
.catvar |
a vector or dataframe containing the categorical variables |
.scheme |
Character string. Approach used to obtain composite weights |
.consistent |
Logical. Should composite/proxy correlations be disattenuated |
.alpha |
minimum threshold of f-test p-value |
.deep |
minimum threshold of deep tree |
.size |
minimum threshold size node |
.size_candidate |
minimum size_candidate node threshold |
.tree |
Logical.Should the tree plot printed |
Details
Internal function
Value
a list checked arguments
Check consistence
Description
############################################################################################
Usage
check_const(.model, .data)
Arguments
.model |
a model in lavaan model syntax |
.data |
a data.frame or a matrix of indicators |
Details
Internal function
Value
a logical value
climate
Description
climate
Usage
climate
Format
climate data refers to the younger emplyees (<=30) of an international bank organizational study. It consists of 32 variables for 669 employees divided into 3 qualitative variables and 29 indicator (or manifest) variables. The 3 categorical variables, reflecting specific employee characteristics as potential observed sources of heterogeneity, gender, job level, and seniority. The 31 indicator (or manifest) variables were loyalty (3 indicators), satisfaction (6 indicators), and the 5 work climate constructs of empowerment (5 indicators), company reputation (3 indicators), pay (4 indicators), work conditions (3 indicators), leadership (5 indicators)
Latent variable description
Loyalty
:Employee commitment to the organization
Satisfaction
:Employee contentedness with their job and aspects such as kind of work, supervision, etc
Empowerment
:Employee perceptions of management vision (vertical or horizontal)
Reputation
:Employee perceptions of the company’s reputation
Leadership
:Employee perceptions of leadership practices such as feedback and appraisal
Pay
:Employee perceptions of pay and of its equity
Conditions
:Employee perceptions regarding the conditions in which they perform their work
Manifest variables description
Emp1
:Employee treatment as responsible
Emp2
:Teamwork is empowered
Emp3
:Autonomy is favored
Emp4
:Confidence in performed tasks
Emp5
:Creativity and initiative are endorsed
Imag1
:Organization’s reputation
Imag2
:Organization’s values
Imag3
:Organization’s customer relationships
Pay1
:Salary
Pay2
:Social benefits
Pay3
:My salary corresponds to my duties
Pay4
:My salary corresponds to my effort
Work1
:Enough personnel in the office
Work2
:Enough time to perform the tasks
Work3
:Conditions and tools for work
Lead1
:Agenda and planning
Lead2
:Receptiveness
Lead3
:Encouraging
Lead4
:Communication
Lead5
:Celebrating success
Sat1
:Overall rating of satisfaction
Sat2
:Tasks in accordance with capabilities
Sat3
:Possibility to know efficiency
Sat4
:Possibility to learn new things
Sat5
:Usefulness of performed job
Sat6
:Fulfilment of expectations
Loy1
:I am unwilling to leave in case of not finding alternative
Loy2
:I am committed to the institution
Loy3
:I trust in the proper direction of the management
Segmentation variables description
Gender
:Gender of the employees, a factor with levels:
male
andfemale
Level
:Level of the employees, a factor with levels:
low
,medium
, andhigh
Seniority
:Time working in the bank, a factor with levels:
<5y
and15-5y
References
Lamberti, G., Aluja Banet, T., & Rialp Criado, J. (2020). Work climate drivers and employee heterogeneity. The International Journal of Human Resource Management, 1-33. doi: 10.1080/09585192.2020.1711798.
Lamberti, G. (2021). Hybrid multigroup partial least squares structural equation modelling: an application to bank employee satisfaction and loyalty. Quality and Quantity, doi: 10.1007/s11135-021-01096-9.
Combinations of a vector element
Description
############################################################################################
Usage
comb(n, r, v = 1:n, set = TRUE, repeats.allowed = FALSE)
Arguments
n |
size of the source vector |
r |
size of the target vectors |
v |
source vector. Defaults to 1:n |
set |
logical flag indicating whether duplicates should be removed from the source vector v |
repeats.allowed |
logical flag indicating whether the constructed vectors may include duplicated values |
Details
Internal function
Value
a matrix of combinations
csibank
Description
csibank
Usage
csibank
Format
csibank data refers to a 2008 marketing research study of a leading Spanish firm providing retail financial services. For confidentiality reasons, the complete details of the survey-based study will not be provided, only a description of the variables. The data include a total of 32 variables, measured for 1707 clients. The 32 variables are divided into two groups: a group formed of 27 indicator variables for the structural model, and a group formed of 5 categorical variables. Each block of indicators refers to a specific construct.
Latent variable description:
IMAG
:Includes variables such as reputation, trustworthiness, seriousness, solidness, and caring about customer's needs
EXPE
:Includes variables such as products and services provided, customer service, solution provision, and expectations for overall quality
QUAL
:Includes variables such as reliable products and services, range of products and services, personal advice, and overall perceived quality
VAL
:Includes variables such as beneficial services and products, valuable investments, quality relative to price, and price relative to quality
SAT
:Includes variables such as overall satisfaction rating, fulfillment of expectations, satisfaction relative to other banks, and performance relative to an ideal bank
LOY
:Includes variables such as likelihood of choosing the same bank again, likelihood of switching to another bank, intention to recommend the bank to friends, and feeling of loyalty
Manifest variables description:
imag1
:Bank's reputation
imag2
:Trustworthiness
imag3
:Bank's solidity
imag4
:Innovation and forward looking
imag5
:Bank's emphasis on public affairs
imag6
:Caring about the customer’s needs
expe1
:Providing products and services to meet the customer's needs
expe2
:Providing customer service
expe3
:Providing solutions to daily banking needs
expe4
:Expectations of overall quality
qual1
:Reliable products and services
qual2
:Range of products and services
qual3
:Degree to which customer feels well informed
qual4
:Personal advice
qual5
:Customer service
qual6
:Overall rating of perceived quality
qual7
:Overall rating of satisfaction
val1
:Beneficial services and products
val2
:Valuable investments
val3
:Quality relative to price
val4
:Price relative to quality
sat1
:Overall rating of satisfaction
sat2
:Fulfillment of expectations
sat3
:Rating the performance relative to customer's ideal bank
loy1
:Propensity to choose the same bank if the customer had to choose again
loy2
:Propensity to switch to other banks if they offered better terms
loy3
:Customer's intention to recommend the bank to friends or colleagues
Categorical variables description:
Gender
:Gender of the customers, a factor with levels:
Female
andMale
Age
:Age of the customers, a factor with levels:
<=25
,26-35
,36-45
,46-55
,56-65
, and>=66
Education
:Education of the customers, a factor with levels:
Elementary
,Graduated
,Highschool
,Undergrad
, andUnfinished
Occupation
:Occupation of the customers, a factor with levels:
Manager
,MediumEmplo
,Notemploy
,OwnFreelan
, andRetired
Region
:Region of residence of the customers, a factor with levels:
Center
,East
,North
Source
Laboratory of Information Analysis and Modeling (LIAM). Facultat de Informatica de Barcelona, Universitat Politecnica de Catalunya.
References
Lamberti, G. et al. (2017). The Pathmox approach for PLS path modeling: discovering which constructs differentiate segments.Applied Stochastic Models in Business and Industry, doi: 10.1002/asmb.2270.
Lamberti, G. (2014) Modeling with Heterogeneity. PhD Dissertation.
Path coefficient labels
Description
############################################################################################
Usage
element(x, l)
Arguments
x |
matrix containing information of casual relationship of latent variables |
Details
Internal function
Value
a vector of path coefficients labels
Vector minimum position
Description
############################################################################################
Usage
f.min(x)
Arguments
x |
vector of values |
Details
Internal function
Value
a list containing minimun value, the position of the minimun and the values different from NA of a vactor
F-coefficients test results for each tree partition
Description
############################################################################################
Usage
fcoef.tree(moxtree)
Arguments
moxtree |
class containing the moxtree elements |
Details
Internal function
Value
the F-coefficients test results for each tree partition
F-global test results for each tree partition
Description
############################################################################################
Usage
fglobal.tree(moxtree)
Arguments
moxtree |
class containing the moxtree elements |
Details
Internal function
Value
the F-global test results for each tree partition
footdata
Description
footdata
Usage
footdata
Format
footdata data refers to a marketing research study from 2018 concerning the experience of watching a football match in the stadium of a top Spanish football club. For confidentiality reasons, the complete details of the survey-based study will not be provided. Only the description of the variables is given. The data consist of a total of 20 variables, measured for 362 spectators. The 20 variables are divided into two groups. One group is formed of 15 indicator variables for the structural model, and the other group is formed of 5 categorical variables. Each block of indicator refers to a specific construct.
Latent variable description
QUA
:Spectators’ perception of service performance, based on evaluations of service dimensions
IMA
:Spectators’ perception of the attributes, players, management and condition of the club
SAT
:Spectators’ evaluation of the perceived benefits of attending a match
LOY
:Spectators’ deeply held commitment to repeat and recommend assisting a match
Manifest variables description
QUA1
:Tickets (availability, information, and staff attitudes)
QUA2
:Accessibility (accessibility, signposting, queue safety, and admission organization)
QUA3
:Facilities (shops, restrooms, seating, restaurants)
QUA4
:Stadium (loudspeakers, appearance, staff competence, cleanliness, Security/safety)
IMA1
:It is a great club
IMA2
:It has a good team
IMA3
:It is an ambitious club
IMA4
:It is a heroic club
SAT1
:The stadium experience was satisfactory
SAT2
:The time spent at the stadium was worth it
SAT3
:The money spent at the stadium was worth it
SAT4
:The experience met all my expectations
SAT5
:Overall satisfaction
LOY1
:I would recommend the experience at this stadium
LOY2
:I intend to repeat the experience at this stadium
Categorical Variables description
gender
:Gender of the spectators, a factor with levels:
FEMALE
andMALE
age
:Age of the spectators, a factor with levels
<=30
,31-45
, and>=46
tourist
:Whether the spectator was a tourist or not, a factor with levels:
YES
orNO
companion
:Who Accompanying the spectator, a factor with levels:
FRIENDS
,FAMILY
, andOTHERS
Involvement
:Degree of involvement, a factor with levels:
FAN
,MEMBER
, andOTHERS
Source
Universitat Autonoma of Barcelona . Business departament, Universitat Autonoma de Barcelona.
References
Lamberti, G., Rialp, J., and Simon, A. (2021). Antecedents of satisfaction and loyalty in different spectator tribes in a football context. International Journal of Sports Marketing and Sponsorship, doi: 10.1108/IJSMS-12-2020-0210;
info class
Description
info is an S4 class that contains info about the tree partition and the the the Fischer statitistcs: F-global and F-coefficientes
General information about the pathmox algorithm
Description
############################################################################################
Usage
info.mox(signif, size, deep, y)
Arguments
signif |
stop condition 1: significance of the p-value |
size |
stop condition 2: minimum number of individuals in a node |
deep |
stop condition 3: maximum tree depth level |
y |
set of segmentation variables |
Details
Internal function
General information about the tree
Description
############################################################################################
Usage
mox.tree(moxtree)
Arguments
moxtree |
class containing the tree elements |
Details
Internal function
Value
a dataframe containing information about the tree and its nodes
moxtree class
Description
moxtree is an S4 class that contains info about moxtree
node class
Description
node is an S4 class that contains info about the node of the tree
Observations belonging to the nodes
Description
############################################################################################
Usage
nodes.tree(moxtree)
Arguments
moxtree |
class containing the moxtree elements |
Details
Internal function
Value
the observations belonging to the nodes
Binary partitions given a segmentation variable (factor).
Description
############################################################################################
Usage
partition(x)
Arguments
x |
single factor or a data.frame of segmenation variables. |
Details
Internal function
Value
a list of matrices containing all possibiles binary partions given a segmenation variable
Best partition given a set of segmentation variables
Description
############################################################################################
Usage
partopt(x, y, inner, .model, .scheme, .consistent, size_candidate)
Arguments
x |
matrix or dataframe containing the dataset |
y |
matrix or dataframe or vector of the segmentation variables |
inner |
a square (lower triangular) boolean matrix representing the inner model (i.e. the path relationships between latent variables) |
.model |
A description of the user-specified model. |
.scheme |
string indicating the type of inner weighting
scheme. Possible values are |
.consistent |
Logical. Should composite/proxy correlations be disattenuated to yield consistent loadings and path estimates if at least one of the construct is modeled as a common factor. Defaults to TRUE. |
size_candidate |
number indicating the minimum threshold for a node |
Details
Internal function
Value
a list containing information of the best partition given a set of segmentation variables
Calculating size (numeber of individual of a node)
Description
############################################################################################
Usage
percent.node(x, size)
Arguments
x |
matrix or dataframe with data. |
size |
value indicating the minimun threshold of number of observations for a node |
Details
Internal function
Value
the number of observations in a node
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)
Pathmox Segmentation Trees in Partial Least Squares Structural Equation Modeling (PLS-SEM)
Description
pls.pathmox
calculates a binary segmentation tree in the context
of partial least squares structural equation modeling (PLS-SEM) following the
PATHMOX algorithm. It detects heterogeneity
in PLS-SEM models when the segmentation variables (categorical
variables), external to the model, are available, and when the objective
of the research is exploratory. pls.pathmox
function returns the
most significant different models associated with the terminal nodes of the
tree. It also returns a ranking according to importance of the categorical
variables used in the split process. pls.pathmox
also enables
the hybrid multigroup analysis (Lamberti, 2021) to be run. In fact, the function
returns an object, .hybrid
, containing the datasets associated
with the terminal nodes prepared to be treated with the cSEM
package
(Rademaker and Schuberth, 2020). It thus enables the MICOM and MGA procedures to be run
(Hair et al., 2017; Henseler et al., 2016; Henseler et al., 2009).
Usage
pls.pathmox(
.model,
.data,
.catvar,
.scheme = "path",
.consistent = TRUE,
.alpha = 0.05,
.deep = 2,
.size = 0.1,
.size_candidate = 50,
.tree = TRUE
)
Arguments
.model |
A description of the user-specified model. The model is described using the lavaan syntax. Structural and measurement models are defined by enclosure between double quotes. The directional link between constructs is defined using the ("~") operator. On the left-hand side of the operator is the dependent construct and on the right-hand side are the explanatory constructs, separated by the ("+") operator. As for the outer model, constructs are defined by listing their corresponding MVs after the operator ("=~") if latent variable is modelled as a common factor, or the operator("<~") if latent variable is modelled as a composite. On the left-hand side of the operator, is the construct and on the right-hand side are the MVs separated by the ("+") operator. Variable labels cannot contain ("."). |
.data |
A matrix or dataframe containing the manifest variables. |
.catvar |
A single factor or set of factors organized as a dataframe containing the categorical variables used as sources of heterogeneity. |
.scheme |
A string indicating the type of inner weighting scheme. Possible
values are |
.consistent |
Logical. Should composite/proxy correlations be disattenuated to yield consistent loadings and path estimates if at least one of the construct is modeled as a common factor. Defaults to TRUE. |
.alpha |
A decimal value indicating the minimum threshold significance
for the partitioning algorithm. By default |
.deep |
An integer indicating the maximum tree depth. Must be an integer equal to or
greater than 1. By default |
.size |
A decimal value indicating the minimum admissible sample size for a node. It is equal to 0.10 by default meaning that the minimum sample size of the node is equal to the 10$ of the total number of observations. |
.size_candidate |
An integer indicating the minimum admissible sample size for a candidate
node. It is equal to |
.tree |
A string indicating if the tree plot must be shown. By default, it is equal to
|
Details
pls.pathmox
uses the classical lavaan syntax to define inner and outer
models and mode. The user can choose to perform the analysis for a
single categorical variable or a set of factors. In the latter case, categorical
variables must be organized as a dataframe. Scheme is equal to path
by
default following other PLS-SEM softwares (SMART-PLS (Ringle at al., 2015),
cSEM R package (Rademaker and Schuberth, 2020)), but can be modified by the user to
"centroid"
or "factorial"
. Stops parameters (.alpha
(threshold
significance for the partitioning algorithm), .deep
(maximum tree depth),
and .size
(minimum admissible sample size for a node)) are fixed respectively to
.alpha
= 0.05, .deep
= 2, and .size
= 0.10 according to Lamberti et al. (2016).
However, again the user can modify these parameters according to the specific
objectives of the analysis. pls.pathmox
also defines a minimum
admissible size for a candidate node that restricts the search of the optimal split
to that partitions that produce nodes with an adequate number of observations.
This parameter (.size_candidate
) is fixed to 50 observations by default.
PLS-SEM model coefficients used in the split process are estimated by applying the
consistent PLS-SEM algorithm proposed by Dijkstra and Henseler (2015). However, the user can choose
to run the analysis by using the classical algorithm by setting to FASLE the paramenter
.consistent
. pls.pathmox
also returns an object containing the datasets associated with
the terminal nodes (object$hybrid
) prepared to be treated with the cSEM
package
(Rademaker and Schuberth, 2020). This means that, once the pathmox finalizes the search for
the most significant different groups associated with the most significant different PLS-SEM models,
the user can perform a detailed analysis for each group using the cSEM
package, or can
run the MICOM and MGA procedures (Hair et al. 2017; Henseler et al. 2016) on the terminal nodes.
Value
An object of class "plstree"
. This is a list with the
following results:
MOX |
dataframe containing the results of the segmentation tree. |
terminal_paths |
dataframe containing PLS-SEM model terminal nodes (path coeff. & R^2). |
var_imp |
dataframe containing the categorical variable ranking by importance. |
Fg.r |
dataframe containing the results of the F-global test for each node partition. |
Fc.r |
list of dataframes containing the results of the F-coefficient test for each node. |
hybrid |
list of datasets associated with the terminal node prepared for MGA with cSEM R package. |
other |
Other parameters and results. |
Author(s)
Giuseppe Lamberti
References
Klesel, M., Schuberth, F., Niehaves, B., and Henseler, J. (2022). Multigroup analysis in information systems research using PLS-PM: A systematic investigation of approaches. ACM SIGMIS Database: the DATABASE for Advances in Information Systems, 53(3), 26-48. doi: 10.1145/3551783.3551787
Hair, J. F., Risher, J. J., Sarstedt, M., and Ringle, C. M. (2019). When to use and how to report the results of PLS-SEM. European business review, 31(1), 2-24. doi: 10.1108/EBR-11-2018-0203
Hair, J. F., Sarstedt, M., Ringle, C. M., and Gudergan, S. P. (2017). Advanced issues in partial least squares structural equation modeling. SAGE publications: Los Angeles
Henseler, J., Ringle, C. M., and Sarstedt, M. (2016). Testing measurement invariance of composites using partial least squares. International marketing review, 33(3), 405-431. doi: 10.1108/IMR-09-2014-0304
Ringle, C. M., and Sinkovics, R. R. (2009). The use of partial least squares path modeling in international marketing. Advances in International Marketing, 20, 277-319. doi: 10.1108/S1474-7979(2009)0000020014
Dijkstra, T. K., and Henseler, J. (2015). Consistent partial least squares path modeling. MIS quarterly, 39(2), 297-316. doi: 10.25300/MISQ/2015/39.2.02
Lamberti, G. (2021). Hybrid multigroup partial least squares structural equation modelling: an application to bank employee satisfaction and loyalty. Quality and Quantity, doi: 10.1007/s11135-021-01096-9
Lamberti, G., Aluja, T. B., and Sanchez, G. (2017). The Pathmox approach for PLS path modeling: Discovering which constructs differentiate segments. Applied Stochastic Models in Business and Industry, 33(6), 674-689. doi: 10.1007/s11135-021-01096-9
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.
Rademaker, M. E., and Schuberth, F. (2020). cSEM: Composite-Based Structural Equation Modeling. Available at https://CRAN.R-project.org/package=cSEM.
Ringle, C.M., Wende, S. and Becker, J.M. (2015). SmartPLS 3. Boenningstedt: SmartPLS. Retrieved from https://www.smartpls.com.
Sanchez, G. (2009). PATHMOX Approach: Segmentation Trees in Partial Least Squares Path Modeling, PhD Dissertation.
Sanchez, G., and Aluja, T. B. (2006). PATHMOX: A PLS-PM Segmentation Algorithm, in Proceedings of the IASC Symposium on Knowledge Extraction by Modelling, International Association for Statistical Computing Island of Capri, Italy 4-6 September.
See Also
print.plstree
, summary.plstree
,
bar_terminal
, bar_impvar
and plot.plstree
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 laavan syntax. Use a set of regression formulas that 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 results by summary
# summary(csi.pathmox)
# Run pathmox on one single variable
age = csibank[,2]
#' # Transform Age into an ordered factor
age = factor(age, levels = c("<=25",
"26-35", "36-45", "46-55",
"56-65", ">=66"),ordered = T)
csi.pathmox.age = pls.pathmox(
.model = CSImodel ,
.data = csibank,
.catvar= age,
.alpha = 0.05,
.deep = 1
)
# Run hybrid multigroup analysis (Lamberti, 2021) using
# the cSEM package (Rademaker and Schuberth, 2020)
# Install and load cSEM library
# Install.packages("cSEM")
# library(cSEM)
# Run cSEM Model for Pathmox terminal nodes
csilocalmodel = csem(
.model = CSImodel,
.data = csi.pathmox.age$hybrid)
# Check invariance and run MGA analysis (Hair et al., 2019)
testMICOM(csilocalmodel, .R = 60)
to_compare <- "
#' # Structural model
VAL ~ QUAL
SAT ~ IMAG + QUAL + VAL
LOY ~ IMAG + SAT
"
testMGD(csilocalmodel, .parameters_to_compare = to_compare,
.R_bootstrap = 60,.approach_mgd = "Henseler")
## End(Not run)
create method plstree
Description
create method plstree
Usage
plstree(x, ...)
Arguments
x |
the element representing the method. |
... |
Further arguments passed on to |
Details
Internal function.
Value
internal method
Print function for Pathmox Segmentation Trees
Description
The function print.plstree
returns the pls.pathmox
results.
Usage
## S3 method for class 'plstree'
print(x, ...)
Arguments
x |
An object of class |
... |
Further arguments are ignored. |
Author(s)
Giuseppe Lamberti
References
Lamberti, G. (2021). Hybrid multigroup partial least squares structural equation modelling: an application to bank employee satisfaction and loyalty. Quality and Quantity, doi: 10.1007/s11135-021-01096-9
Lamberti, G., Aluja, T. B., and Sanchez, G. (2017). The Pathmox approach for PLS path modeling: Discovering which constructs differentiate segments. Applied Stochastic Models in Business and Industry, 33(6), 674-689. doi: 10.1007/s11135-021-01096-9
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
, pls.pathmox
,
bar_terminal
, bar_impvar
and plot.plstree
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 laavan 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
"
# Run pathmox on one single variable
age = csibank[,2]
# Transform age into an ordered factor
age = factor(age, levels = c("<=25", "26-35", "36-45", "46-55",
"56-65", ">=66"),ordered = T)
csi.pathmox.age = pls.pathmox(
.model = CSImodel ,
.data = csibank,
.catvar= age,
.alpha = 0.05,
.deep = 1
)
# Visualize the Pathmox results
print(csi.pathmox.age)
## End(Not run)
printing the tree structure
Description
############################################################################################
Usage
printTree(moxtree)
Arguments
moxtree |
moxtree object |
Details
Internal function.
Value
the tree structure
Observations belonging to the root node
Description
############################################################################################
Usage
root.tree(moxtree)
Arguments
moxtree |
class containing the moxtree elements |
Details
Internal function
Value
the observations belonging to the root node
Calculating Deepth stop criterion
Description
############################################################################################
Usage
showDeepth(node)
Arguments
node |
id that identifies a specicif node |
Details
Internal function
Value
deepth of the tree
Best partition for a specific segmentation variable
Description
############################################################################################
Usage
splitopt(x, inner, .model, .scheme, .consistent, splits, fact, size_candidate)
Arguments
x |
matrix or data frame containing the manifest variables. |
inner |
a square (lower triangular) boolean matrix representing the inner model (i.e. the path relationships between latent variables) |
.model |
A description of the user-specified model. |
.scheme |
string indicating the type of inner weighting
scheme. Possible values are |
.consistent |
Logical. Should composite/proxy correlations be disattenuated to yield consistent loadings and path estimates if at least one of the construct is modeled as a common factor. Defaults to TRUE. |
splits |
vector indicating the binary partition. |
fact |
vector indicating the categorical variable. |
size_candidate |
number indicating the minimum threshold for a node. |
Details
Internal function
Value
a list containing information about the bets partition for a specific segmentation variable.
Summary function for Pathmox Segmentation Trees
Description
The function summary.plstrees
returns the most important results obtained
by the function pls.pathmox
. In order, it provides the parameters of the algorithm
(threshold significance, node size limit, tree depth level and the method used for the
split partition), the basic characteristics of the tree (depth and number of terminal
nodes), the split results (F-global and F-coefficient). It also returns a ranking of the
categorical variables by importance and the terminal node results (path coefficients and R^2).
Usage
## S3 method for class 'plstree'
summary(object, ...)
Arguments
object |
An object of class |
... |
Further arguments are ignored. |
Author(s)
Giuseppe Lamberti
References
Lamberti, G. (2021). Hybrid multigroup partial least squares structural equation modelling: an application to bank employee satisfaction and loyalty. Quality and Quantity, doi: 10.1007/s11135-021-01096-9
Lamberti, G., Aluja, T. B., and Sanchez, G. (2017). The Pathmox approach for PLS path modeling: Discovering which constructs differentiate segments. Applied Stochastic Models in Business and Industry, 33(6), 674-689. doi: 10.1007/s11135-021-01096-9
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
print.plstree
, pls.pathmox
,
bar_terminal
, bar_impvar
and plot.plstree
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 laavan 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
"
# Run pathmox on one single variable
age = csibank[,2]
# Transform age into an ordered factor
age = factor(age, levels = c("<=25", "26-35", "36-45", "46-55",
"56-65", ">=66"),ordered = T)
csi.pathmox.age = pls.pathmox(
.model = CSImodel ,
.data = csibank,
.catvar= age,
.alpha = 0.05,
.deep = 1
)
# Visualize the Pathmox results
summary(csi.pathmox.age)
## End(Not run)
Observations belonging to the terminal nodes
Description
############################################################################################
Usage
terminal.tree(moxtree)
Arguments
moxtree |
class containing the moxtree element. |
Details
Internal function
Value
the observations belonging to the terminal nodes
Cheking F-tests results
Description
############################################################################################
Usage
test.partition(x, inner, .model, .scheme, .consistent, modtwo, alpha)
Arguments
x |
matrix or dataframe containing the data. |
inner |
a square (lower triangular) boolean matrix representing the inner model. |
.model |
A description of the user-specified model. |
.scheme |
string indicating the type of inner weighting
scheme. Possible values are |
.consistent |
Logical. Should composite/proxy correlations be disattenuated to yield consistent loadings and path estimates if at least one of the construct is modeled as a common factor. Defaults to TRUE. |
modtwo |
vector indicating the binary partition. |
alpha |
value indicating the threshold a stop condition. |
Details
Internal function
Value
list containing matrices needed for the comparison test.
Ranking of variables importance
Description
############################################################################################
Usage
var_imp_mox(x, y)
Arguments
x |
matrix or dataframe containing the data |
y |
vector or dataframe containing the categorical variables |
Details
Internal function
Value
a dataframe containg the ranking of the categorical variable