I am not quite sure what the differences are between the outputs and results of disstreedisplay and seqtreedisplay. Maybe you could explain me the differences? The TraMineR users guide and the otherwise detailed working paper about the WeightedCluster library do not explain so much about that. Here is my example R script:


mvad.alphabet <- c("employment", "FE", "HE", "joblessness", "school", "training")
mvad.labels <- c("Employment", "Further Education", "Higher Education", "Joblessness", 
"School", "Training")
mvad.scodes <- c("EM", "FE", "HE", "JL", "SC", "TR")
mvadseq <- seqdef(mvad[, 17:86], alphabet = mvad.alphabet, states = mvad.scodes, 
labels = mvad.labels, weights = mvad$weight, xtstep = 6)

mvad.ham <- seqdist(mvadseq, method="HAM")

seqtree <- seqtree(mvadseq ~ gcse5eq + Grammar + funemp, data=mvad, diss=mvad.ham, 
seqtreedisplay(seqtree, type="d", border=NA)

disstree <- disstree(mvaddist ~ gcse5eq + Grammar + funemp, data = mvad, R = 10)
disstreedisplay(disstree, imagefunc=seqdplot, imagedata=mvadseq, border=NA, 
withlegend=FALSE, axes=FALSE, ylab="")

You need to have installed GraphViz to see the graphs.


Sequence regression trees and dissimilarity based trees are fully presented in the following paper:

Studer, M., Ritschard, G., Gabadinho, A. & Müller, N.S. (2011), "Discrepancy Analysis of State Sequences", Sociological Methods and Research. Vol. 40(3), pp. 471-510.

Basically, seqtree and seqtreedisplay are shortcuts (helper functions) to disstree and disstreedisplay functions (specifying some defaults such as the plotting and printing function to use and so on). disstree is more general and can be used to analyse any kind of objects described by a distance matrix.

The difference in your output comes from the use of the weights. seqtree uses the sequences weights by default (those defined in seqdef). If you use disstree, you need to specify the weights explicitly to get the same result.

Thus, disstree must be:

disstree <- disstree(mvad.ham ~ gcse5eq + Grammar + funemp, data=mvad,
weights=mvad$weight, R=10, weight.permutation="diss")

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.