<p style="margin:0;padding:0;" align="left"><br />Thanks a lot<br /></p> <br /> <br /> <br /><br /><blockquote style="padding-left: 5px; margin-left: 5px; border-left: 2px solid #ff0000">> Message du 02/08/12 12:25<br />> De : "Gilbert Ritschard" <br />> A : "Users questions" <br />> Copie à : <br />> Objet : Re: [Traminer-users] dendrogram<br />><br />> The identify.hclust function works on dendrograms obtained by plotting <br />> the outcome of hclust. The following example works perfectly on my system:<br />> <br />> ####### start of example ###########<br />> ## generating the state sequence object (from preview on the TraMineR <br />> web page)<br />> library(TraMineR)<br />> data(mvad)<br />> mvad.alphabet <- c("employment", "FE", "HE", "joblessness", "school",<br />> "training")<br />> mvad.labels <- c("employment", "further education", "higher education",<br />> "joblessness", "school", "training")<br />> mvad.scodes <- c("EM", "FE", "HE", "JL", "SC", "TR")<br />> mvad.seq <- seqdef(mvad, 17:86, alphabet = mvad.alphabet, states = <br />> mvad.scodes,<br />> labels = mvad.labels, xtstep = 6)<br />> <br />> ## OM distances<br />> dist.om1 <- seqdist(mvad.seq, method = "OM", indel = 1, sm = "TRATE")<br />> <br />> ## generating the hierarchical clusters with hclust<br />> hca <- hclust(as.dist(dist.om1))<br />> plot(hca)<br />> <br />> ## now using identify on the dendrogram produced by the above plot function<br />> (x <- identify(hca))<br />> <br />> ###### end example ########<br />> <br />> Best,<br />> Gilbert<br />> <br />> <br />> On 01-Aug-12 17:54, so.bellit wrote:<br />> ><br />> ><br />> > I would like to use the "identify" function in order to know how <br />> > identify clusters in the dendogram. But it seems not work with the <br />> > Optimal Matching Analysis.<br />> ><br />> > Thanks<br />> > Sonia<br />> ><br />> ><br />> ><br />> ><br />> ><br />> > > Message du 01/08/12 11:29<br />> > > De : "so.bellit"<br />> > > A : "Users questions"<br />> > > Copie à :<br />> > > Objet : [Traminer-users] dendrogram<br />> > ><br />> > ><br />> ><br />> > Hi,<br />> ><br />> > Anyone knows if we can link the cluster or individuals with the<br />> > dendrogram?<br />> ><br />> > Thanks<br />> > Sonia<br />> ><br />> ><br />> ><br />> ><br />> ><br />> > > 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<br />> > (seqIplot) by more than one variable<br />> > ><br />> > > Hi Jan,<br />> ><br />> ><br />> > ><br />> ><br />> > Yes, that worked. Using the order() function, I created a new,<br />> > sorted version of the sequence object and got the sort order I<br />> > wanted.<br />> ><br />> ><br />> > ><br />> ><br />> > Thanks!<br />> ><br />> > Joel<br />> ><br />> ><br />> > ><br />> ><br />> > On Jul 19, 2012, at 10:53 AM, Jan Goebel wrote:<br />> ><br />> ><br />> > Dear Joel,<br />> > ><br />> > > the help page on plot.stslist states that sortv has to<br />> > be a variable name:<br />> > ><br />> > > sortv: name of an optional variable used to sort the<br />> > sequences<br />> > > before plotting.<br />> > ><br />> > > So my guess is, that you have to create a new variable<br />> > within your data frame and not to supply an "external" vector.<br />> > ><br />> > > However ?seqIplot has in my opinion at least some<br />> > fuzziness, because here you find:<br />> > > "The ‘sortv’ argument can be used to pass a vector of<br />> > numerical values for sorting the sequences. See<br />> > ‘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 />> > ><br />> ><br />> > Hi Alexis,<br />> > > <br />> ><br />> ><br />> > > <br />> ><br />> > I tried your suggestion and for some reason it's not<br />> > working, even when I create a sorting<br />> > > <br />> ><br />> > variable that uses a single variable to sort on.<br />> > Here's what I did:<br />> > > <br />> ><br />> ><br />> > > <br />> ><br />> > # Original version, which works fine. See first<br />> > attached file below, which shows plot is<br />> > > <br />> ><br />> > clearly sorted by f09as.<br />> > > <br />> ><br />> > seqIplot(df.seq09, border = NA, withlegend = "right",<br />> > sortv=df09$f09as)<br />> > > <br />> ><br />> ><br />> > > <br />> ><br />> > # Create sorting variable<br />> > > <br />> ><br />> > term.sort = order(df09$f09as)<br />> > > <br />> ><br />> ><br />> > > <br />> ><br />> > # Create plot again, using sorting variable. This<br />> > version of the plot is unsorted. See second<br />> > > <br />> ><br />> > attached file.<br />> > > <br />> ><br />> > seqIplot(df.seq09, border = NA, withlegend = "right",<br />> > sortv=term.sort)<br />> > > <br />> ><br />> ><br />> > > <br />> ><br />> > I checked the sorting variable by looking at what it<br />> > does to the original data frame and it<br />> > > <br />> ><br />> > looked exactly like it should, so the sorting variable<br />> > doesn't seem to have a problem. Here's<br />> > > <br />> ><br />> > the command I used for that: df09[order(df09$f09as), ]<br />> > > <br />> ><br />> ><br />> > > <br />> ><br />> > Any idea what could be going wrong? If it would help<br />> > to look at the sequence object or<br />> > > <br />> ><br />> > data.frame I'm working with, I can send those.<br />> > > <br />> ><br />> ><br />> > > <br />> ><br />> > Thanks again,<br />> > > <br />> ><br />> > Joel<br />> > > <br />> ><br />> ><br />> > > <br />> ><br />> ><br />> > > <br />> ><br />> > =<br />> > > <br />> ><br />> ><br />> > > <br />> ><br />> ><br />> > > <br />> ><br />> ><br />> > > <br />> ><br />> ><br />> > > <br />> ><br />> ><br />> > > <br />> ><br />> ><br />> > > <br />> ><br />> ><br />> > > <br />> ><br />> > On Jul 16, 2012, at 12:10 AM, Alexis gabadinho wrote:<br />> > > <br />> ><br />> ><br />> > > <br />> ><br />> > Hi Joel,<br />> > > <br />> ><br />> ><br />> > > <br />> ><br />> > Use first the order function to create one single<br />> > sorting variable, and then pass this<br />> > > <br />> ><br />> > variable to the seqIplot function. Here is an<br />> > example with the biofam data frame where<br />> > > <br />> ><br />> > sequences are sorted by gender and birthyr<br />> > > <br />> ><br />> ><br />> > > <br />> ><br />> > data(biofam)<br />> > > <br />> ><br />> > biofam.seq <- seqdef(biofam, 10:25)<br />> > > <br />> ><br />> > csort <- order(biofam$sex, biofam$birthyr)<br />> > > <br />> ><br />> > seqIplot(biofam.seq, sortv=csort)<br />> > > <br />> ><br />> ><br />> > > <br />> ><br />> > All the best,<br />> > > <br />> ><br />> > Alexis<br />> > > <br />> ><br />> ><br />> > > <br />> ><br />> ><br />> > > <br />> ><br />> > Le 16. 07. 12 08:12, Joel Schwartz a écrit :<br />> > > <br />> ><br />> > I'm a new TraMineR user and just ran into a<br />> > problem while using the seqIplot function. I'm<br />> > > <br />> ><br />> > making a plot of hundreds of sequences. To<br />> > make it possible to see patterns, I'm trying to<br />> > > <br />> ><br />> > sort the sequences by more than one variable.<br />> > It works as expected when I sort by one<br />> > > <br />> ><br />> > variable. But when I try to sort by more than<br />> > one, I get the exact same result as when I<br />> > > <br />> ><br />> > sort by one variable.<br />> > > <br />> ><br />> ><br />> > > <br />> ><br />> > Here are the two commands I'm using<br />> > > <br />> ><br />> ><br />> > > <br />> ><br />> > # Sort by one variable<br />> > > <br />> ><br />> > seqIplot(df.seq, border=NA,<br />> > withlegend="right", sortv=df$s09as)<br />> > > <br />> ><br />> ><br />> > > <br />> ><br />> > # Sort by two variables<br />> > > <br />> ><br />> > seqIplot(df.seq, border = NA,<br />> > withlegend="right", sortv=c(df$s09as, df$f09as))<br />> > > <br />> ><br />> ><br />> > > <br />> ><br />> > I get the exact same plot either way, and no<br />> > warnings or errors.<br />> > > <br />> ><br />> ><br />> > > <br />> ><br />> > Is there a way to sort by more than one variable?<br />> > > <br />> ><br />> ><br />> > > <br />> ><br />> > Thanks for your help.<br />> > > <br />> ><br />> ><br />> > > <br />> ><br />> > Best Wishes,<br />> > > <br />> ><br />> > Joel Schwartz<br />> > > <br />> ><br />> ><br />> > > <br />> ><br />> ><br />> > > <br />> ><br />> ><br />> > > <br />> ><br />> ><br />> > > <br />> ><br />> > _______________________________________________<br />> > > <br />> ><br />> > Traminer-users mailing list<br />> > > <br />> ><br />> > Traminer-users@lists.r-forge.r-project.org<br />> > <br />> > > <br />> ><br />> > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/traminer-users<br />> > > <br />> ><br />> ><br />> > > <br />> ><br />> > _______________________________________________<br />> > > <br />> ><br />> > Traminer-users mailing list<br />> > > <br />> ><br />> > Traminer-users@lists.r-forge.r-project.org<br />> > <br />> > > <br />> ><br />> > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/traminer-users<br />> > > <br />> ><br />> ><br />> > > <br />> ><br />> > =<br />> > > <br />> ><br />> ><br />> > > <br />> ><br />> ><br />> > > <br />> ><br />> > This body part will be downloaded on demand.<br />> > > <br />> ><br />> ><br />> > > <br />> ><br />> ><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 />> > > Traminer-users@lists.r-forge.r-project.org<br />> > <br />> > ><br />> > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/traminer-users<br />> > ><br />> > ><br />> ><br />> ><br />> > ><br />> ><br />> > ><br />> > > [ (pas de nom de fichier) (0.2 Ko) ]<br />> ><br />> > ><br />> > > [ (pas de nom de fichier) (0.2 Ko) ]<br />> ><br />> ><br />> ><br />> > _______________________________________________<br />> > Traminer-users mailing list<br />> > Traminer-users@lists.r-forge.r-project.org<br />> > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/traminer-users<br />> <br />> <br />> _______________________________________________<br />> Traminer-users mailing list<br />> Traminer-users@lists.r-forge.r-project.org<br />> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/traminer-users<br />> </blockquote>