<p style="margin:0;padding:0;" align="left">Hi, <br /><br />  Anyone knows if we can link the cluster or individuals  with the dendrogram?<br /><br />Thanks<br />Sonia<br /></p> <br /> <br /> <br /><br /><blockquote style="padding-left: 5px; margin-left: 5px; border-left: 2px solid #ff0000">> Message du 23/07/12 17:49<br />> De : "Joel Schwartz" <br />> A : "Users questions" <br />> Copie à : <br />> Objet : Re: [Traminer-users] how to sort a sequence plot (seqIplot) by more than one variable<br />><br />> Hi Jan,<p style="margin:0;padding:0;"><br />> </p><p style="margin:0;padding:0;">Yes, that worked. Using the order() function, I created a new, sorted version of the sequence object and got the sort order I wanted. </p><p style="margin:0;padding:0;"><br />> </p><p style="margin:0;padding:0;">Thanks!</p><p style="margin:0;padding:0;">Joel</p><p style="margin:0;padding:0;"><br />> <p style="margin:0;padding:0;"><p style="margin:0;padding:0;">On Jul 19, 2012, at 10:53 AM, Jan Goebel wrote:</p><br /><blockquote><p style="margin:0;padding:0;">Dear Joel,<br />> <br />> the help page on plot.stslist states that sortv has to be a variable name:<br />> <br />>    sortv: name of an optional variable used to sort the sequences<br />>           before plotting.<br />> <br />> So my guess is, that you have to create a new variable within your data frame and not to supply an "external" vector.<br />> <br />> However ?seqIplot has in my opinion at least some fuzziness, because here you find:<br />> "The ‘sortv’ argument can be used to pass a vector of numerical values for sorting the sequences. See ‘plot.stslist’ for a complete list of optional arguments."<br />> <br />> Best wishes,<br />> <br />> Jan<br />> <br />> On 07/17/2012 03:25 PM, Joel Schwartz wrote:<br />> <blockquote>Hi Alexis,<br />> </blockquote><blockquote><br />> </blockquote><blockquote>I tried your suggestion and for some reason it's not working, even when I create a sorting<br />> </blockquote><blockquote>variable that uses a single variable to sort on. Here's what I did:<br />> </blockquote><blockquote><br />> </blockquote><blockquote># Original version, which works fine. See first attached file below, which shows plot is<br />> </blockquote><blockquote>clearly sorted by f09as.<br />> </blockquote><blockquote>seqIplot(df.seq09, border = NA, withlegend = "right", sortv=df09$f09as)<br />> </blockquote><blockquote><br />> </blockquote><blockquote># Create sorting variable<br />> </blockquote><blockquote>term.sort = order(df09$f09as)<br />> </blockquote><blockquote><br />> </blockquote><blockquote># Create plot again, using sorting variable. This version of the plot is unsorted. See second<br />> </blockquote><blockquote>attached file.<br />> </blockquote><blockquote>seqIplot(df.seq09, border = NA, withlegend = "right", sortv=term.sort)<br />> </blockquote><blockquote><br />> </blockquote><blockquote>I checked the sorting variable by looking at what it does to the original data frame and it<br />> </blockquote><blockquote>looked exactly like it should, so the sorting variable doesn't seem to have a problem. Here's<br />> </blockquote><blockquote>the command I used for that: df09[order(df09$f09as), ]<br />> </blockquote><blockquote><br />> </blockquote><blockquote>Any idea what could be going wrong? If it would help to look at the sequence object or<br />> </blockquote><blockquote>data.frame I'm working with, I can send those.<br />> </blockquote><blockquote><br />> </blockquote><blockquote>Thanks again,<br />> </blockquote><blockquote>Joel<br />> </blockquote><blockquote><br />> </blockquote><blockquote><br />> </blockquote><blockquote>=<br />> </blockquote><blockquote><br />> </blockquote><blockquote><br />> </blockquote><blockquote><br />> </blockquote><blockquote><br />> </blockquote><blockquote><br />> </blockquote><blockquote><br />> </blockquote><blockquote><br />> </blockquote><blockquote>On Jul 16, 2012, at 12:10 AM, Alexis gabadinho wrote:<br />> </blockquote><blockquote><br />> </blockquote><blockquote><blockquote>Hi Joel,<br />> </blockquote></blockquote><blockquote><blockquote><br />> </blockquote></blockquote><blockquote><blockquote>Use first the order function to create one single sorting variable, and then pass this<br />> </blockquote></blockquote><blockquote><blockquote>variable to the seqIplot function. Here is an example with the biofam data frame where<br />> </blockquote></blockquote><blockquote><blockquote>sequences are sorted by gender and birthyr<br />> </blockquote></blockquote><blockquote><blockquote><br />> </blockquote></blockquote><blockquote><blockquote>data(biofam)<br />> </blockquote></blockquote><blockquote><blockquote>biofam.seq <- seqdef(biofam, 10:25)<br />> </blockquote></blockquote><blockquote><blockquote>csort <- order(biofam$sex, biofam$birthyr)<br />> </blockquote></blockquote><blockquote><blockquote>seqIplot(biofam.seq, sortv=csort)<br />> </blockquote></blockquote><blockquote><blockquote><br />> </blockquote></blockquote><blockquote><blockquote>All the best,<br />> </blockquote></blockquote><blockquote><blockquote>Alexis<br />> </blockquote></blockquote><blockquote><blockquote><br />> </blockquote></blockquote><blockquote><blockquote><br />> </blockquote></blockquote><blockquote><blockquote>Le 16. 07. 12 08:12, Joel Schwartz a écrit :<br />> </blockquote></blockquote><blockquote><blockquote><blockquote>I'm a new TraMineR user and just ran into a problem while using the seqIplot function. I'm<br />> </blockquote></blockquote></blockquote><blockquote><blockquote><blockquote>making a plot of hundreds of sequences. To make it possible to see patterns, I'm trying to<br />> </blockquote></blockquote></blockquote><blockquote><blockquote><blockquote>sort the sequences by more than one variable. It works as expected when I sort by one<br />> </blockquote></blockquote></blockquote><blockquote><blockquote><blockquote>variable. But when I try to sort by more than one, I get the exact same result as when I<br />> </blockquote></blockquote></blockquote><blockquote><blockquote><blockquote>sort by one variable.<br />> </blockquote></blockquote></blockquote><blockquote><blockquote><blockquote><br />> </blockquote></blockquote></blockquote><blockquote><blockquote><blockquote>Here are the two commands I'm using<br />> </blockquote></blockquote></blockquote><blockquote><blockquote><blockquote><br />> </blockquote></blockquote></blockquote><blockquote><blockquote><blockquote># Sort by one variable<br />> </blockquote></blockquote></blockquote><blockquote><blockquote><blockquote>seqIplot(df.seq, border=NA, withlegend="right", sortv=df$s09as)<br />> </blockquote></blockquote></blockquote><blockquote><blockquote><blockquote><br />> </blockquote></blockquote></blockquote><blockquote><blockquote><blockquote># Sort by two variables<br />> </blockquote></blockquote></blockquote><blockquote><blockquote><blockquote>seqIplot(df.seq, border = NA, withlegend="right", sortv=c(df$s09as, df$f09as))<br />> </blockquote></blockquote></blockquote><blockquote><blockquote><blockquote><br />> </blockquote></blockquote></blockquote><blockquote><blockquote><blockquote>I get the exact same plot either way, and no warnings or errors.<br />> </blockquote></blockquote></blockquote><blockquote><blockquote><blockquote><br />> </blockquote></blockquote></blockquote><blockquote><blockquote><blockquote>Is there a way to sort by more than one variable?<br />> </blockquote></blockquote></blockquote><blockquote><blockquote><blockquote><br />> </blockquote></blockquote></blockquote><blockquote><blockquote><blockquote>Thanks for your help.<br />> </blockquote></blockquote></blockquote><blockquote><blockquote><blockquote><br />> </blockquote></blockquote></blockquote><blockquote><blockquote><blockquote>Best Wishes,<br />> </blockquote></blockquote></blockquote><blockquote><blockquote><blockquote>Joel Schwartz<br />> </blockquote></blockquote></blockquote><blockquote><blockquote><blockquote><br />> </blockquote></blockquote></blockquote><blockquote><blockquote><blockquote><br />> </blockquote></blockquote></blockquote><blockquote><blockquote><blockquote><br />> </blockquote></blockquote></blockquote><blockquote><blockquote><blockquote><br />> </blockquote></blockquote></blockquote><blockquote><blockquote><blockquote>_______________________________________________<br />> </blockquote></blockquote></blockquote><blockquote><blockquote><blockquote>Traminer-users mailing list<br />> </blockquote></blockquote></blockquote><blockquote><blockquote><blockquote><a href="mailto:Traminer-users@lists.r-forge.r-project.org">Traminer-users@lists.r-forge.r-project.org</a><br />> </blockquote></blockquote></blockquote><blockquote><blockquote><blockquote><a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/traminer-users">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/traminer-users</a><br />> </blockquote></blockquote></blockquote><blockquote><blockquote><br />> </blockquote></blockquote><blockquote><blockquote>_______________________________________________<br />> </blockquote></blockquote><blockquote><blockquote>Traminer-users mailing list<br />> </blockquote></blockquote><blockquote><blockquote><a href="mailto:Traminer-users@lists.r-forge.r-project.org">Traminer-users@lists.r-forge.r-project.org</a> <<a href="mailto:Traminer-users@lists.r-forge.r-project.org">mailto:Traminer-users@lists.r-forge.r-project.org</a>><br />> </blockquote></blockquote><blockquote><blockquote><a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/traminer-users">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/traminer-users</a><br />> </blockquote></blockquote><blockquote><br />> </blockquote><blockquote>=<br />> </blockquote><blockquote><br />> </blockquote><blockquote><br />> </blockquote><blockquote>This body part will be downloaded on demand.<br />> </blockquote><blockquote><br />> </blockquote><br />> -- <br />> -----------------------------------------<br />>  Dr. Jan Goebel<br />>  Head of the Division<br />>  Data Operation and Research Data Center<br />> <br />>  DIW Berlin<br />>  Socio-Economic Panel Study (SOEP)<br />>  Mohrenstr. 58<br />>  D-10117 Berlin -- Germany --<br />>  phone: +49 30 89789-377<br />> -----------------------------------------<br />> <br />> _______________________________________________<br />> Traminer-users mailing list<br />> <a href="mailto:Traminer-users@lists.r-forge.r-project.org">Traminer-users@lists.r-forge.r-project.org</a><br />> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/traminer-users<br />> <br />> </p></blockquote></p><br />> </p>><br />> [ (pas de nom de fichier) (0.2 Ko) ]</blockquote>