# Dissimilarity Tree

### Description

Tree structured discrepancy analysis of objects described by their pairwise dissimilarities.

### Usage

1 2 3 4 |

### Arguments

`formula` |
Formula with a dissimilarity matrix as left hand side and the candidate partitioning variables on the right side. |

`data` |
Data frame where variables in formula will be searched for. |

`weights` |
Optional numerical vector of weights. |

`minSize` |
Minimum number of cases in a node, will be treated as a proportion if less than 1. |

`maxdepth` |
Maximum depth of the tree |

`R` |
Number of permutations used to assess the significance of the split. |

`pval` |
Maximum allowed p-value for a split |

`object` |
An optional R object represented by the dissimilarity matrix. This object may be used by the |

`weight.permutation` |
Weight permutation method: |

`squared` |
Logical: Should the |

`first` |
One of the variable in the right-hand side of the formula. This forces the first node of the tree to be split by this variable. |

### Details

The procedure iteratively splits the data. At each step, the procedure selects the variable and split that explain the greatest part of the discrepancy, i.e., the split for which we get the highest pseudo R2. The significance of the retained split is assessed through a permutation test.

`seqtree`

provides a simpler interface if you plan to use `disstree`

for state sequence objects.

### Value

An object of class `disstree`

that contains the following components:

`root` |
A node object, root of the tree |

`info` |
General information such as parameters used to build the tree |

`info$adjustment` |
A |

`formula` |
The formula used to generate the tree |

`data` |
data used to build the tree |

`weights` |
weights |

### Author(s)

Matthias Studer (with Gilbert Ritschard for the help page)

### References

Studer, M., G. Ritschard, A. Gabadinho and N. S. Müller (2011). Discrepancy analysis of state sequences, *Sociological Methods and Research*, Vol. 40(3), 471-510.

Studer, M., G. Ritschard, A. Gabadinho and N. S. Müller (2010)
Discrepancy analysis of complex objects using dissimilarities.
In F. Guillet, G. Ritschard, D. A. Zighed and H. Briand (Eds.),
*Advances in Knowledge Discovery and Management*,
Studies in Computational Intelligence, Volume 292, pp. 3-19. Berlin: Springer.

Studer, M., G. Ritschard, A. Gabadinho and N. S. Müller (2009)
Analyse de dissimilarités par arbre d'induction. In EGC 2009,
*Revue des Nouvelles Technologies de l'Information*, Vol. E-15, pp. 7-18.

Anderson, M. J. (2001) A new method for non-parametric multivariate analysis of variance.
*Austral Ecology* **26**, 32-46.

Batagelj, V. (1988) Generalized ward and related clustering problems. In H. Bock (Ed.),
*Classification and related methods of data analysis*, Amsterdam: North-Holland, pp. 67-74.

Piccarreta, R. et F. C. Billari (2007) Clustering work and family trajectories by using a divisive
algorithm. *Journal of the Royal Statistical Society A* **170**(4), 1061–1078.

### See Also

`seqtree`

to generate a specific `disstree`

objects for analyzing state sequences.

`seqtreedisplay`

to generate graphic representation of `seqtree`

objects when analyzing state sequences.

`disstreedisplay`

is a more general interface to generate such representation for other type of objects.

`dissvar`

to compute discrepancy using dissimilarities and for a basic introduction to discrepancy analysis.

`dissassoc`

to test association between objects represented by their dissimilarities and a covariate.

`dissmfac`

to perform multi-factor analysis of variance from pairwise dissimilarities.

`disscenter`

to compute the distance of each object to its group center from pairwise dissimilarities.

### Examples

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | ```
data(mvad)
## Defining a state sequence object
mvad.seq <- seqdef(mvad[, 17:86])
## Computing dissimilarities (any dissimilarity measure can be used)
mvad.ham <- seqdist(mvad.seq, method="HAM")
dt <- disstree(mvad.ham~ male + Grammar + funemp + gcse5eq + fmpr + livboth,
data=mvad, R = 10)
print(dt)
## Will only work if GraphViz is properly installed
## See seqtree for simpler way to plot a sequence tree.
## Not run:
disstreedisplay(dt, imagefunc=seqdplot, imagedata=mvad.seq,
## Additional parameters passed to seqdplot
withlegend=FALSE, axes=FALSE, ylab="")
## End(Not run)
## Second method, using a specific function
myplotfunction <- function(individuals, seqs, ...) {
par(font.sub=2, mar=c(3,0,6,0), mgp=c(0,0,0))
## using mds to order sequence in seqiplot
mds <- cmdscale(seqdist(seqs[individuals,], method="HAM"),k=1)
seqiplot(seqs[individuals,], sortv=mds,...)
}
## If imagedata is not set, index of individuals are sent to imagefunc
## Not run:
disstreedisplay(dt, imagefunc=myplotfunction, title.cex=3,
## additional parameters passed to myplotfunction
seqs=mvad.seq,
## additional parameters passed to seqiplot (through myplotfunction)
withlegend=FALSE, axes=FALSE, tlim=0, space=0, ylab="", border=NA)
## End(Not run)
``` |