[Traminer-users] Plot of Representative Sequences

Alexis Gabadinho alexis.gabadinho at unige.ch
Fri Nov 15 11:04:45 CET 2013

Dear Jeremry,

The plot is created by using the seqrep function with all three 
criteria, then retrieving the index of the representatives and using 
them to select the sequences to plot in the whole set with the tlim 

Here is a code example, where
- "seq.object" is the sequence object,
- "dist" is  the pairwise distance matrix
- "max.dist" is the maximum theoretical distance between two sequences 
(it is provided because it is not sure wether the maximum observed 
distance equal the theoretical maximum)

## Sequences representatives
medoid <- seqrep(seq.object, criterion="dist", nrep=1, dist.matrix=dist, 
freq <- seqrep(seq.object, criterion="freq", nrep=1, dist.matrix=dist, 
density <- seqrep(seq.object, criterion="density", nrep=1, 
dist.matrix=dist, dmax=max.dist)

rep.idx <- c(attr(freq,"Index")[1], attr(density,"Index")[1],
seqiplot(seq.object, tlim=rep.idx, withlegend=FALSE, title="Title", 

Best regards,

Le 14. 11. 13 22:15, Jeremy Reynolds a écrit :
> Dear TraMineR Users,
> Does anyone know how Gabadinho and Ritschard produced figure 5 of 
> their paper (see link below)? For each group, it has one plot showing 
> three different sequences: the sequence that is most frequent, the 
> sequence with the highest neighborhood density, and the sequence that 
> is most central.
> I can do a plot with one of the three sequences for each group, but 
> I'm not sure how to combine the three into a single plot.
> Thanks,
> Jeremy
> Gabadinho A, Ritschard G (2013). "Searching for typical life 
> trajectories applied to child birth histories", In R Lévy, E. Widmer 
> (eds.),/Gendered Life Courses/, pp. 287-312. Vienna: LIT.
> http://mephisto.unige.ch/pub/publications/gr/GabadhinoRitschard-TypicalTrajectories2013.pdf
> -- 
> ********************
> Dr. Jeremy Reynolds
> Associate Professor
> Undergraduate Coordinator
> Department of Sociology
> 116 Baldwin Hall
> University of Georgia
> Athens, GA 30602-1611
> Phone: (706) 583-8072
> Web: http://uga.edu/soc/people/faculty/reynolds_jeremy.php
> Fax: (706) 542-4320
> _______________________________________________
> 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/20131115/cd9d3890/attachment.html>

More information about the Traminer-users mailing list