<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Hi Michael,<br>
      <br>
      Indeed, the solution is to first transform your spell data into
      the sts format using seqformat and then to merge it with the
      demographic data. Otherwise you get the error message since you
      pass as group argument a vector that contains much more rows than
      the number of sequences in your sequence object.<br>
      <br>
      Alexis<br>
      <br>
      <br>
      Le 19. 09. 12 08:33, Hadrien Commenges a écrit :<br>
    </div>
    <blockquote
      cite="mid:928593260.201086.1348036413862.JavaMail.root@clara"
      type="cite">
      <style type="text/css">p { margin: 0; }</style>
      <div style="font-family: arial,helvetica,sans-serif; font-size:
        12pt; color: #000000">Hi Michael,<br>
        <br>
        I think you don't have to merge your demographic data with your
        states/events data, it seems to me that it's the source of your
        problem. For my part, I always work with two objects: the
        state/event object (sts object) and a dataframe with
        individual's id and variables. Try to convert your spell data
        without the status variable (educ4), and to get your
        individual's data in a separate dataframe. Then you can try :<br>
        <br>
        seqiplot(data.seq, group = individuals$group, ...)<br>
        <br>
        Hope it helps.<br>
        <br>
        Hadrien<br>
        <br>
        <hr id="zwchr">
        <div
style="color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>De:
          </b>"Michael Corey" <a class="moz-txt-link-rfc2396E" href="mailto:michael.corey@gmail.com"><michael.corey@gmail.com></a><br>
          <b>À: </b><a class="moz-txt-link-abbreviated" href="mailto:Traminer-users@lists.r-forge.r-project.org">Traminer-users@lists.r-forge.r-project.org</a><br>
          <b>Envoyé: </b>Mercredi 19 Septembre 2012 02:17:05<br>
          <b>Objet: </b>[Traminer-users] Problems passing/using group
          command<br>
          <br>
          <p style="margin:0px 0px 1em;padding:">
            Hi All,</p>
          <p style="margin:0px 0px 1em;padding:">
            <br>
          </p>
          <p style="margin:0px 0px 1em;padding:">
            I'm having a problem using the group function in TraMineR. I
            have a data set that contains SPELL data, so multiple rows
            per case. I also have demographic data per case, at one row
            per case. I merge these together and end up with data that
            has a demographic covariate per row, so multiple rows per
            case. An example of this data would be:</p>
          <pre class="default prettyprint" style="margin-top:0px;margin-bottom:10px;padding:5px;border:0px;font-size:15px;vertical-align:baseline;overflow:auto;width:auto;max-height:600px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;background-color:;line-height:20px"><code style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;color:"><span class="pln" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:black">id startmin stopmin activity educ4

</span><span class="lit" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:maroon">4</span><span class="pln" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:black">      </span><span class="lit" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:maroon">1</span><span class="pln" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:black">      </span><span class="lit" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:maroon">20</span><span class="pln" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:black">       work    HS

</span><span class="lit" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:maroon">4</span><span class="pln" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:black">      </span><span class="lit" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:maroon">20</span><span class="pln" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:black">     </span><span class="lit" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:maroon">40</span><span class="pln" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:black">       play    HS

</span><span class="lit" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:maroon">8</span><span class="pln" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:black">      </span><span class="lit" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:maroon">1</span><span class="pln" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:black">      </span><span class="lit" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:maroon">15</span><span class="pln" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:black">       sleep   </span><span class="typ" style="margin:">College</span><span class="pln" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:black">

</span><span class="lit" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:maroon">8</span><span class="pln" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:black">      </span><span class="lit" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:maroon">15</span><span class="pln" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:black">     </span><span class="lit" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:maroon">40</span><span class="pln" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:black">       work    </span><span class="typ" style="margin:">College</span><span class="pln" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:black">

</span></code></pre>
          <p style="margin:0px 0px 1em;padding:">
            I can make sequence data from this, but when I try to run a
            plot using the group command</p>
          <pre class="default prettyprint" style="margin-top:0px;margin-bottom:10px;padding:5px;border:0px;font-size:15px;vertical-align:baseline;overflow:auto;width:auto;max-height:600px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;background-color:;line-height:20px"><code style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;color:"><span class="pln" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:black">      seqiplot</span><span class="pun" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:black">(</span><span class="pln" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:black">atus</span><s
an class="pun" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:black">.</span><span class="pln" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:black">seq</span><span class="pun" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:black">,</span><span class="pln" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:black"> </span><span class="kwd" style="margin:">group</span><span class="pln" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:black"> </span><span class="pun" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:black">=</span><span class="pln" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:black"> atus</span><span class="pun" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:black">.</sp
n><span class="pln" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:black">seqdata$educ4</span><span class="pun" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:black">,</span><span class="pln" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:black"> border</span><span class="pun" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:black">=</span><span class="pln" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:black">NA</span><span class="pun" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:black">,</span><span class="pln" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:black"> 

               withlegend</span><span class="pun" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:black">=</span><span class="str" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:maroon">"right"</span><span class="pun" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:black">,</span><span class="pln" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:black">  cex</span><span class="pun" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:black">.</span><span class="pln" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:black">plot</span><span class="pun" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:black">=.</span><span class="lit" style="margin:0px;padding:0px;border:0px;font-size:13px
vertical-align:baseline;color:maroon">55</span><span class="pun" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:black">)</span><span class="pln" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:black">

</span></code></pre>
          <p style="margin:0px 0px 1em;padding:">
            it tells me:</p>
          <pre class="default prettyprint" style="margin-top:0px;margin-bottom:10px;padding:5px;border:0px;font-size:15px;vertical-align:baseline;overflow:auto;width:auto;max-height:600px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;background-color:;line-height:20px"><code style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;color:"><span class="pln" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:black">    </span><span class="pun" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:black">></span><span class="str" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:maroon">"Error: group must conta
n one value for each row in the sequence object"</span><span class="pun" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:black">.</span><span class="pln" style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:black">

</span></code></pre>
          <p style="margin:0px 0px 1em;padding:">
            I have gotten this to work with the example of the mvad data
            in the training manual, but I can't seem to get it to work
            with the groups, whether I link to the original demographic
            data, the merged data, or try to pass the covariates by
            seqformat and seqdef. Ideas?</p>
          <p style="margin:0px 0px 1em;padding:">
            Thanks,</p>
          <p style="margin:0px 0px 1em;padding:">
            Michael</p>
          <br>
          _______________________________________________<br>
          Traminer-users mailing list<br>
          <a class="moz-txt-link-abbreviated" href="mailto:Traminer-users@lists.r-forge.r-project.org">Traminer-users@lists.r-forge.r-project.org</a><br>
<a class="moz-txt-link-freetext" 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></div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Traminer-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Traminer-users@lists.r-forge.r-project.org">Traminer-users@lists.r-forge.r-project.org</a>
<a class="moz-txt-link-freetext" 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>
</pre>
    </blockquote>
    <br>
  </body>
</html>