Learn R Programming

genpathmox (version 0.2)

plot.xtree.pls: Plot function for the Pathmox Segmentation Trees: PLS-PM

Description

The function plot.xtree.pls allows to drow PATHMOX tree for PLS-PM

Usage

## S3 method for class 'xtree.pls':
plot(x, root.col = "grey", node.col = "orange",
  leaf.col = "green2", shadow.size = 0.003, node.shadow = "red",
  leaf.shadow = "darkgreen", cex = 0.7, seg.col = "blue3", lwd = 1,
  show.pval = TRUE, pval.col = "blue", main = NULL, cex.main = 1, ...)

Arguments

x
An object of class "xtree.pls" returned by pls.pathmox
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 plot.xtree.pls.

Examples

Run this code
## example of PLS-PM in alumni satisfaction

 data(fibtele)

 # select manifest variables
 data.fib <-fibtele[,12:35]

 # define inner model matrix
 Image 			= rep(0,5)
	 Qual.spec	= rep(0,5)
	 Qual.gen		= rep(0,5)
	 Value			= c(1,1,1,0,0)
	 Satis			= c(1,1,1,1,0)
 inner.fib <- rbind(Image,Qual.spec, Qual.gen, Value, Satis)
 colnames(inner.fib) <- rownames(inner.fib)

 # blocks of indicators (outer model)
 outer.fib <- list(1:8,9:11,12:16,17:20,21:24)
 modes.fib  = rep("A", 5)

 # apply plspm
 pls.fib <- plspm(data.fib, inner.fib, outer.fib, modes.fib)


 # re-ordering those segmentation variables with ordinal scale
  seg.fib= fibtele[,2:11]

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

 # Pathmox Analysis
 fib.pathmox=pls.pathmox(pls.fib,seg.fib,signif=0.05,
					deep=2,size=0.2,n.node=20)

 # plot pathmox tree
 plot(pls.fib)

Run the code above in your browser using DataLab