Thanks, that worked great.<br><br><div class="gmail_quote">On Wed, Sep 19, 2012 at 4:07 AM, Alexis Gabadinho <span dir="ltr"><<a href="mailto:Alexis.Gabadinho@unige.ch" target="_blank">Alexis.Gabadinho@unige.ch</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    <div>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 type="cite">
      
      <div style="font-size:12pt;font-family:arial,helvetica,sans-serif"><div class="im">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>
        </div><div style="font-size:12pt;font-style:normal;font-family:Helvetica,Arial,sans-serif;text-decoration:none;font-weight:normal"><div class="im"><b>De:
          </b>"Michael Corey" <a href="mailto:michael.corey@gmail.com" target="_blank"><michael.corey@gmail.com></a><br>
          <b>À: </b><a href="mailto:Traminer-users@lists.r-forge.r-project.org" target="_blank">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>
            Hi All,</p>
          <p>
            <br>
          </p>
          <p>
            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><code><span style="vertical-align:baseline;font-size:13px;margin:0px;border:0px;padding:0px">id startmin stopmin activity educ4

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

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

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

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

</span></code></pre>
          <p>
            I can make sequence data from this, but when I try to run a
            plot using the group command</p>
          </div><pre><code><span style="vertical-align:baseline;font-size:13px;margin:0px;border:0px;padding:0px">      seqiplot</span><span style="vertical-align:baseline;font-size:13px;margin:0px;border:0px;padding:0px">(</span><span style="vertical-align:baseline;font-size:13px;margin:0px;border:0px;padding:0px">atus<
 /span><s style="vertical-align:baseline;font-size:13px;margin:0px;border:0px;padding:0px">.</s></span><span style="vertical-align:baseline;font-size:13px;margin:0px;border:0px;padding:0px">seq</span><span style="vertical-align:baseline;font-size:13px;margin:0px;border:0px;padding:0px">,</span><span style="vertical-align:baseline;font-size:13px;margin:0px;border:0px;padding:0px"> </span><span>group</span><span style="vertical-align:baseline;font-size:13px;margin:0px;border:0px;padding:0px"> </span><span style="vertical-align:baseline;font-size:13px;margin:0px;border:0px;padding:0px">=</span><span style="vertical-align:baseline;font-size:13px;margin:0px;border:0px;padding:0px"> atus</span><span style="vertical-align:baseline;font-size:13px;margin:0px;border:0px;padding:0px">.<u></u><span style="vertical-align:baseline;font-size:13px;margin:0px;border:0px;padding:0px">seqdata$educ4</span><span style="vertical-align:baseline;font-size:13px;margin:0px;border:0px;padding:0px">,</span><span style="vertical-align:baseline;font-size:13px;margin:0px;border:0px;padding:0px"> border</span><span style="vertical-align:baseline;font-size:13px;margin:0px;border:0px;padding:0px">=</span><span style="vertical-align:baseline;font-size:13px;margin:0px;border:0px;padding:0px">NA</span><span style="vertical-align:baseline;font-size:13px;margin:0px;border:0px;padding:0px">,</span><span style="vertical-align:baseline;font-size:13px;margin:0px;border:0px;padding:0px"> 

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

</span></span></code></pre>
          <p>
            it tells me:</p>
          <pre><code><span style="vertical-align:baseline;font-size:13px;margin:0px;border:0px;padding:0px">    </span><span style="vertical-align:baseline;font-size:13px;margin:0px;border:0px;padding:0px">></span><span style="margin:0px;padding:0px;border:0px;font-size:13px;vertical-align:baseline;color:maroon">"Error: group mu
 st conta
n one value for each row in the sequence object"</span><span style="vertical-align:baseline;font-size:13px;margin:0px;border:0px;padding:0px">.</span><span style="vertical-align:baseline;font-size:13px;margin:0px;border:0px;padding:0px">

</span></code></pre><div class="im">
          <p>
            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>
            Thanks,</p>
          <p>
            Michael</p>
          <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></div></div>
        <br>
      </div><div class="im">
      <br>
      <fieldset></fieldset>
      <br>
      <pre>_______________________________________________
Traminer-users mailing list
<a href="mailto:Traminer-users@lists.r-forge.r-project.org" target="_blank">Traminer-users@lists.r-forge.r-project.org</a>
<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>
</pre>
    </div></blockquote>
    <br>
  </div>

<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>
<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></blockquote></div><br>