<div dir="ltr"><div><div>Dear Alexis and Chris,<br><br></div>Thank you very much for your help with the special seqrplot plot.  I have an additional question that you or someone else on the list can probably answer easily.<br>
<br>In experimenting with seqrplot, I have found that when I request plots for each cluster in a cluster solution I get a different result than when I try to get a single plot using only the data from one cluster.  I have included an example below.  Shouldn't these be the same? Am I doing something wrong when selecting the cases to use in the second sqrplot command?<br>
<br></div><div>Thanks,<br><br>Jeremy<br><br></div><div>P.S. Has anyone identified a color scheme for sequence index plots that works well when the plot has to be black & white or grey scale?<br><br>############<br></div>
# My example code<br><div>############<br>data(mvad)<br>mvad.labels <- c("employment", "further education", "higher education", "joblessness", "school", "training")<br>
mvad.scode <- c("EM", "FE", "HE", "JL", "SC", "TR")<br>mvad.seq <- seqdef(mvad, 17:86, states = mvad.scode, labels = mvad.labels, xtstep = 6)<br>ccost <- seqsubm(mvad.seq, method = "CONSTANT", cval = 2)<br>
<a href="http://seq.om">seq.om</a> <- seqdist(mvad.seq, method = "OM", sm = ccost)<br>clusterward <- agnes(<a href="http://seq.om">seq.om</a>, diss = TRUE, method = "ward")<br>cluster3 <- cutree(clusterward, k = 3)<br>
cluster3 <- factor(cluster3, labels = c("Type 1", "Type 2", "Type 3"))<br>table(cluster3)<br><br>#representative sequences for each cluster<br>seqrplot(mvad.seq, group = cluster3, dist.matrix = <a href="http://seq.om">seq.om</a>, border = NA)<br>
<br>#representative sequences for a particular cluster (here cluster 1)<br>#why are the results not the same as when done by group in the previous seqrplot?   (# of sequences and coverage do not match output from above)<br>
clust1 <- which(cluster3=="Type 1")<br>seqrplot(mvad.seq[clust1,], dist.matrix = <a href="http://seq.om">seq.om</a>, border = NA)<br><br><br>############<br># The output<br>############<br>> #representative sequences for each cluster<br>
  > seqrplot(mvad.seq, group = cluster3, dist.matrix = <a href="http://seq.om">seq.om</a>, border = NA)<br>[>] number of objects (sum of weights): 295<br>[>] max. distance: 140<br>[>] neighborhood radius: 14<br>
[>] 1 representative(s) selected, coverage=32% (threshold=25%)<br>[>] 186 distinct sequence(s)<br>[>] number of objects (sum of weights): 164<br>[>] max. distance: 140<br>[>] neighborhood radius: 14<br>[>] 2 representative(s) selected, coverage=39% (threshold=25%)<br>
[>] 98 distinct sequence(s)<br>[>] number of objects (sum of weights): 253<br>[>] max. distance: 140<br>[>] neighborhood radius: 14<br>[>] 3 representative(s) selected, coverage=30% (threshold=25%)<br>[>] 206 distinct sequence(s)<br>
> #representative sequences for a particular cluster (here cluster 1)<br>  > #why are the results not the same as when done by group in the previous seqrplot?  (# of sequences and coverage do not match output from above)<br>
  > clust1 <- which(cluster3=="Type 1")<br>> seqrplot(mvad.seq[clust1,], dist.matrix = <a href="http://seq.om">seq.om</a>, border = NA)<br>[>] number of objects (sum of weights): 295<br>[>] max. distance: 140<br>
[>] neighborhood radius: 14<br>[>] 3 representative(s) selected, coverage=27% (threshold=25%)<br>[>] 186 distinct sequence(s)<br><br><br><div><div><div class="gmail_extra"><br><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;font-style:normal;background-color:rgb(225,226,229);font-weight:normal;line-height:15px;border-collapse:separate;text-transform:none;font-size:13px;white-space:pre-wrap;font-family:'Lucida Console';word-spacing:0px"><pre style="font-family:'Lucida Console';font-size:10pt!important;outline-style:none;outline-width:initial;outline-color:initial;border-style:none;border-width:initial;border-color:initial;white-space:pre-wrap!important;margin:0px;line-height:1.2">
<span style="white-space:pre-wrap;color:blue"><br></span><span style="color:rgb(197,6,11)"></span></pre></span><br><br><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">


Today's Topics:<br>
<br>
   1. Plot of Representative Sequences (Jeremy Reynolds)<br>
   2. Re: Plot of Representative Sequences (Chris Cameron)<br>
   3. Re: Plot of Representative Sequences (Alexis Gabadinho)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Thu, 14 Nov 2013 16:15:49 -0500<br>
From: Jeremy Reynolds <<a href="mailto:jeremyr@uga.edu" target="_blank">jeremyr@uga.edu</a>><br>
To: <a href="mailto:traminer-users@lists.r-forge.r-project.org" target="_blank">traminer-users@lists.r-forge.r-project.org</a><br>
Subject: [Traminer-users] Plot of Representative Sequences<br>
Message-ID:<br>
        <CABicVB9xs7V33HQ=<a href="mailto:vFYYKjOxULd5fzZjgFBOZOeTmqkVYragQQ@mail.gmail.com" target="_blank">vFYYKjOxULd5fzZjgFBOZOeTmqkVYragQQ@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="iso-8859-1"<br>
<br>
Dear TraMineR Users,<br>
<br>
Does anyone know how Gabadinho and Ritschard produced figure 5 of their<br>
paper (see link below)? For each group, it has one plot showing three<br>
different sequences: the sequence that is most frequent, the sequence with<br>
the highest neighborhood density, and the sequence that is most central.<br>
<br>
I can do a plot with one of the three sequences for each group, but I'm not<br>
sure how to combine the three into a single plot.<br>
<br>
Thanks,<br>
<br>
Jeremy<br>
<br>
Gabadinho A, Ritschard G (2013). "Searching for typical life trajectories<br>
applied to child birth histories", In R L?vy, E. Widmer (eds.), *Gendered<br>
Life Courses*, pp. 287-312. Vienna: LIT.<br>
<br>
<a href="http://mephisto.unige.ch/pub/publications/gr/GabadhinoRitschard-TypicalTrajectories2013.pdf" target="_blank">http://mephisto.unige.ch/pub/publications/gr/GabadhinoRitschard-TypicalTrajectories2013.pdf</a><br>
<br>
--<br>
********************<br>
Dr. Jeremy Reynolds<br>
Associate Professor<br>
Undergraduate Coordinator<br>
Department of Sociology<br>
116 Baldwin Hall<br>
University of Georgia<br>
Athens, GA 30602-1611<br>
Phone: <a href="tel:%28706%29%20583-8072" value="+17065838072" target="_blank">(706) 583-8072</a><br>
Web: <a href="http://uga.edu/soc/people/faculty/reynolds_jeremy.php" target="_blank">http://uga.edu/soc/people/faculty/reynolds_jeremy.php</a><br>
Fax: <a href="tel:%28706%29%20542-4320" value="+17065424320" target="_blank">(706) 542-4320</a><br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.r-forge.r-project.org/pipermail/traminer-users/attachments/20131114/8906d0a6/attachment-0001.html" target="_blank">http://lists.r-forge.r-project.org/pipermail/traminer-users/attachments/20131114/8906d0a6/attachment-0001.html</a>><br>


<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Thu, 14 Nov 2013 16:35:43 -0500<br>
From: Chris Cameron <<a href="mailto:cjc73@cornell.edu" target="_blank">cjc73@cornell.edu</a>><br>
To: Users questions <<a href="mailto:traminer-users@r-forge.wu-wien.ac.at" target="_blank">traminer-users@r-forge.wu-wien.ac.at</a>><br>
Subject: Re: [Traminer-users] Plot of Representative Sequences<br>
Message-ID: <<a href="mailto:0996DFC3-86BB-4629-8F7C-9EC42255217A@cornell.edu" target="_blank">0996DFC3-86BB-4629-8F7C-9EC42255217A@cornell.edu</a>><br>
Content-Type: text/plain; charset="iso-8859-1"<br>
<br>
Hi Jeremy<br>
<br>
I think you would create a new input sequences set with only the desired sequences and then use seqiplot.<br>
You can also just plot particular values using indexing. Does this work for your case?<br>
<br>
seqiplot(morn.dss[c(1,6,10),])<br>
<br>
Chris Cameron<br>
PhD Candidate<br>
Dept of Sociology<br>
Cornell University<br>
<br>
<br>
On Nov 14, 2013, at 4:15 PM, Jeremy Reynolds <<a href="mailto:jeremyr@uga.edu" target="_blank">jeremyr@uga.edu</a>> wrote:<br>
<br>
> Dear TraMineR Users,<br>
><br>
> 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.<br>


><br>
> 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.<br>
><br>
> Thanks,<br>
><br>
> Jeremy<br>
><br>
> 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.<br>
><br>
> <a href="http://mephisto.unige.ch/pub/publications/gr/GabadhinoRitschard-TypicalTrajectories2013.pdf" target="_blank">http://mephisto.unige.ch/pub/publications/gr/GabadhinoRitschard-TypicalTrajectories2013.pdf</a><br>


><br>
><br>
> --<br>
> ********************<br>
> Dr. Jeremy Reynolds<br>
> Associate Professor<br>
> Undergraduate Coordinator<br>
> Department of Sociology<br>
> 116 Baldwin Hall<br>
> University of Georgia<br>
> Athens, GA 30602-1611<br>
> Phone: <a href="tel:%28706%29%20583-8072" value="+17065838072" target="_blank">(706) 583-8072</a><br>
> Web: <a href="http://uga.edu/soc/people/faculty/reynolds_jeremy.php" target="_blank">http://uga.edu/soc/people/faculty/reynolds_jeremy.php</a><br>
> Fax: <a href="tel:%28706%29%20542-4320" value="+17065424320" target="_blank">(706) 542-4320</a><br>
> _______________________________________________<br>
> Traminer-users mailing list<br>
> <a href="mailto:Traminer-users@lists.r-forge.r-project.org" target="_blank">Traminer-users@lists.r-forge.r-project.org</a><br>
> <a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/traminer-users" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/traminer-users</a><br>
<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.r-forge.r-project.org/pipermail/traminer-users/attachments/20131114/b2122592/attachment-0001.html" target="_blank">http://lists.r-forge.r-project.org/pipermail/traminer-users/attachments/20131114/b2122592/attachment-0001.html</a>><br>


<br>
------------------------------<br>
<br>
Message: 3<br>
Date: Fri, 15 Nov 2013 11:04:45 +0100<br>
From: Alexis Gabadinho <<a href="mailto:alexis.gabadinho@unige.ch" target="_blank">alexis.gabadinho@unige.ch</a>><br>
To: <<a href="mailto:traminer-users@lists.r-forge.r-project.org" target="_blank">traminer-users@lists.r-forge.r-project.org</a>><br>
Subject: Re: [Traminer-users] Plot of Representative Sequences<br>
Message-ID: <<a href="mailto:5285F1BD.5090905@unige.ch" target="_blank">5285F1BD.5090905@unige.ch</a>><br>
Content-Type: text/plain; charset="iso-8859-1"; Format="flowed"<br>
<br>
Dear Jeremry,<br>
<br>
The plot is created by using the seqrep function with all three<br>
criteria, then retrieving the index of the representatives and using<br>
them to select the sequences to plot in the whole set with the tlim<br>
argument.<br>
<br>
Here is a code example, where<br>
- "seq.object" is the sequence object,<br>
- "dist" is  the pairwise distance matrix<br>
- "max.dist" is the maximum theoretical distance between two sequences<br>
(it is provided because it is not sure wether the maximum observed<br>
distance equal the theoretical maximum)<br>
<br>
## Sequences representatives<br>
medoid <- seqrep(seq.object, criterion="dist", nrep=1, dist.matrix=dist,<br>
dmax=max.dist)<br>
freq <- seqrep(seq.object, criterion="freq", nrep=1, dist.matrix=dist,<br>
dmax=max.dist)<br>
density <- seqrep(seq.object, criterion="density", nrep=1,<br>
dist.matrix=dist, dmax=max.dist)<br>
<br>
rep.idx <- c(attr(freq,"Index")[1], attr(density,"Index")[1],<br>
     attr(medoid,"Index")[1])<br>
seqiplot(seq.object, tlim=rep.idx, withlegend=FALSE, title="Title",<br>
border=NA)<br>
<br>
Best regards,<br>
Alexis<br>
<br>
<br>
Le 14. 11. 13 22:15, Jeremy Reynolds a ?crit :<br>
> Dear TraMineR Users,<br>
><br>
> Does anyone know how Gabadinho and Ritschard produced figure 5 of<br>
> their paper (see link below)? For each group, it has one plot showing<br>
> three different sequences: the sequence that is most frequent, the<br>
> sequence with the highest neighborhood density, and the sequence that<br>
> is most central.<br>
><br>
> I can do a plot with one of the three sequences for each group, but<br>
> I'm not sure how to combine the three into a single plot.<br>
><br>
> Thanks,<br>
><br>
> Jeremy<br>
><br>
> Gabadinho A, Ritschard G (2013). "Searching for typical life<br>
> trajectories applied to child birth histories", In R L?vy, E. Widmer<br>
> (eds.),/Gendered Life Courses/, pp. 287-312. Vienna: LIT.<br>
><br>
> <a href="http://mephisto.unige.ch/pub/publications/gr/GabadhinoRitschard-TypicalTrajectories2013.pdf" target="_blank">http://mephisto.unige.ch/pub/publications/gr/GabadhinoRitschard-TypicalTrajectories2013.pdf</a><br>


><br>
><br>
> --<br>
> ********************<br>
> Dr. Jeremy Reynolds<br>
> Associate Professor<br>
> Undergraduate Coordinator<br>
> Department of Sociology<br>
> 116 Baldwin Hall<br>
> University of Georgia<br>
> Athens, GA 30602-1611<br>
> Phone: <a href="tel:%28706%29%20583-8072" value="+17065838072" target="_blank">(706) 583-8072</a><br>
> Web: <a href="http://uga.edu/soc/people/faculty/reynolds_jeremy.php" target="_blank">http://uga.edu/soc/people/faculty/reynolds_jeremy.php</a><br>
> Fax: <a href="tel:%28706%29%20542-4320" value="+17065424320" target="_blank">(706) 542-4320</a><br>
><br>
><br>
> _______________________________________________<br>
> Traminer-users mailing list<br>
> <a href="mailto:Traminer-users@lists.r-forge.r-project.org" target="_blank">Traminer-users@lists.r-forge.r-project.org</a><br>
> <a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/traminer-users" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/traminer-users</a><br>
<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.r-forge.r-project.org/pipermail/traminer-users/attachments/20131115/cd9d3890/attachment-0001.html" target="_blank">http://lists.r-forge.r-project.org/pipermail/traminer-users/attachments/20131115/cd9d3890/attachment-0001.html</a>><br>


<br>
------------------------------<br>
<br>
_______________________________________________<br>
Traminer-users mailing list<br>
<a href="mailto:Traminer-users@lists.r-forge.r-project.org" target="_blank">Traminer-users@lists.r-forge.r-project.org</a><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/traminer-users" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/traminer-users</a><br>
<br>
End of Traminer-users Digest, Vol 35, Issue 2<br>
*********************************************<br>
</blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr">********************<br>Dr. Jeremy Reynolds<br>Associate Professor<br>Undergraduate Coordinator<br>Department of Sociology<br>116 Baldwin Hall<br>University of Georgia<br>

Athens, GA 30602-1611<br>Phone: <a href="tel:%28706%29%20583-8072" value="+17065838072" target="_blank">(706) 583-8072</a><br>Web: <a href="http://uga.edu/soc/people/faculty/reynolds_jeremy.php" target="_blank">http://uga.edu/soc/people/faculty/reynolds_jeremy.php</a><br>
Fax: <a href="tel:%28706%29%20542-4320" value="+17065424320" target="_blank">(706) 542-4320</a></div>

</div></div></div></div></div>