Learn R Programming

genpathmox (version 0.3)

plot.treemodelreg: Comparative plot between nodes from or the Pathmox Segmentation Trees: linear and LAD regression

Description

Plot method for objects of class "treemodelreg". Barplots of path coefficients of terminal nodes with respect to those of the global (root) model

Usage

# S3 method for treemodelreg
plot(x, main.node = FALSE, names.nodes = NULL,
  eti = FALSE, lab.vec = NULL, short.min = NULL, cex.names = 1,
  cex.axis = 1.2, cex.main = 1, lim = c(-0.5, 0.5), short.labs = TRUE,
  ...)

Arguments

x

An object of class "treemodelreg" returned by reg.treemodel.

main.node

It is string. If iequl to TRUE you have to inidcate the main of each barplot in "names.nodes".

names.nodes

Optional vector of names for each the terminal node (must be a vector of length equal to the number of terminal nodes).

eti

is string. If it is TRUE the label of each coefficients for all the terminal nodes must be specify in "lab.vec". If it is false the labels are defined by the programe.

lab.vec

Optional vector of names for each coefficient of the terminal nodes (must be a vector of length equal to the number of coefficients).

short.min

Integer number indicating the minimum length of the.

cex.names

Allows to fix the size of coefficient labels. Equal to 1 to default.

cex.axis

Allows to fix the size of axes. Equal to 1.2 to default.

cex.main

Allows to fix the size of the main. Equal to 1 to default.

lim

Allows to fix the axes interval. Equal to (-0.5,0.5) to default.

short.labs

Logical value indicating if the labels of the barplots.

Further arguments passed on to plot.treemodelreg.

reg.treemodel, reg.pathmox

Details

This function aims to visualize the comparison between coefficients of the terminal nodes against the coefficients coefficients of the global model in the root node.

References

Aluja, T. Lamberti, G. Sanchez, G. (2013). Modeling with heterogeneity. Meetings of Italian Statistical Society, Advances in Latent Variables - Methods, Models and Applications. Brescia.

Lamberti, G. (2014) Modeling with Heterogeneity. PhD Dissertation.

Sanchez, G. (2009) PATHMOX Approach: Segmentation Trees in Partial Least Squares Path Modeling. PhD Dissertation.

Examples

Run this code
# NOT RUN {
##example of LM in alumni satisfaction

data(fibtelereg)

segvar = fibtelereg[,2:11]

#select the variables
data.fib = fibtelereg[,12:18]

segvar$Age 		= factor(segvar$Age, ordered=T)
segvar$Salary 	= factor(segvar$Salary,
	levels=c("<18k","25k","35k","45k",">45k"), ordered=T)
segvar$Accgrade = factor(segvar$Accgrade,
	levels=c("accnote<7","7-8accnote","accnote>8"), ordered=T)
segvar$Grade 	= factor(segvar$Grade,
	levels=c("<6.5note","6.5-7note","7-7.5note",">7.5note"), ordered=T)

#regression PATHMOX
fib.reg.pathmox = reg.pathmox(Satisfact~.,data=data.fib,segvar,
	signif=0.05,deep=2,method="lm",size=0.15)

#terminal nodes comparison
fib.node.comp = reg.treemodel(fib.reg.pathmox)

 #Drawing the bar-plots
plot(fib.node.comp)


# }
# NOT RUN {
data(fibtelereg)

#identify the segmentation variables
segvar= fibtelereg[1:50,3:4]

#select the variables
data.fib=fibtelereg[1:50,12:18]

fib.reg.pathmox=reg.pathmox(Satisfact~.,data=data.fib,segvar,
		signif=0.05,deep=1,method="lm",size=0.15)

fib.node.comp=reg.treemodel(fib.reg.pathmox)

plot(fib.node.comp)
# }

Run the code above in your browser using DataLab