[Traminer-users] seqtreedisplay

Matthias Studer Matthias.Studer at unige.ch
Thu Feb 16 13:52:26 CET 2012


Dear Alois,

I will use the following example (taken from ?seqtree)

library(TraMineR)
data(mvad)

## Defining a state sequence object
mvad.seq<- seqdef(mvad[, 17:86])

## Building a seqtree using a specified distance matrix
mvad.dhd<- seqdist(mvad.seq, method="DHD")
seqt<- seqtree(mvad.seq~ male + Grammar + funemp + gcse5eq + fmpr + livboth,
     data=mvad, R = 1000, diss=mvad.dhd)



seqtreedisplay works in the same way as seqplot (difference are 
explained in ?seqtreedisplay). So you may use type="f" to plot the most 
frequent sequences (or all). You can set the following options
     space=0 (no blank space between sequences)
     border=NA (no border)
     tlim = 0 (plot all sequence, if you set tlim=1:5, then the five 
most frequent one will be potted)

This ends up with the following code:
seqtreedisplay(seqt, type="f", space=0, border=NA, tlim=0)

I think that there are other way to order sequence index plot that 
produce much more readable output. For instance, you may use the first 
dimension of an MDS.

mds <- cmdscale(mvad.dhd, k=1)

The sorting of the sequence in index-plot (type="I") is done through the 
sortv argument

seqtreedisplay(seqt, type="I", sortv=mds)


Hope this helps,

Matthias Studer

Le 15.02.2012 16:44, Alois Ganter a écrit :
>
> How can I generate a sequence tree that contains sequence index plots 
> with sequences arranged in descending/ascending frequency order? Stata 
> has the egen rank () command to compile a sequence index plots this 
> way. How does it work with seqtreedisplay()?
>
> *Thanks for your help.*
>
> **
>
> *Best,*
>
> *Alois*
>
> **
>
> **
>
> *Mit freundlichen Grüßen*
>
> *_______________________________________________________________*
>
> MSM_groß.jpg**
>
> **
>
> *Dipl.-Volksw. Alois Ganter*
>
> Universität Duisburg-Essen, Campus Duisburg
>
> Mercator School of Management - Fachbereich Betriebswirtschaft
>
> Department Management and Marketing
>
> Lehrstuhl für Organisations- und Personalökonomie
>
> Lotharstr. 65 / LC 015b
>
> 47057 Duisburg
>
> Tel.: +49 (0)203-379 2874
>
> Fax: +49 (0)203-379 1402
>
> E-Mail: alois.ganter at uni-due.de <mailto:achim.hecker at uni-due.de>
>
> Homepage: udue.de/ganter <http://www.msm.uni-due.de/organisation>
>
>
>
> _______________________________________________
> Traminer-users mailing list
> Traminer-users at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/traminer-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/traminer-users/attachments/20120216/e74020b3/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 2537 bytes
Desc: not available
URL: <http://lists.r-forge.r-project.org/pipermail/traminer-users/attachments/20120216/e74020b3/attachment.jpe>


More information about the Traminer-users mailing list