<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
    <link href="chrome://translator/skin/floatingPanel.css"
      type="text/css" rel="stylesheet">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Dear Juan Zuluaga,<br>
    <br>
    I agree with you. Our example dataset lacks an example with a
    quantitative covariate. <br>
    <br>
    There are two solutions to analyse the link with a quantitative
    covariate. The first one is to discretize the variable before using
    it (an example is given below). The second solution is to use the
    tree procedure. This procedure automatically finds the best cutting
    points by testing all possible binary splits.&nbsp; This will also work
    with ordinal covariates.<br>
    <br>
    An example of both solutions is given below using the biofam dataset
    (Swiss family life sequences between 15 and 30 years old).<br>
    <br>
    ## Loading TraMineR<br>
    library(TraMineR)<br>
    ## Loading the biofam dataset<br>
    data(biofam)<br>
    <br>
    ## States labels<br>
    bf.labels &lt;- c("Parent", "Left", "Married", "Left/Married",&nbsp;
    "Child", <br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "Left/Child", "Left/Married/Child", "Divorced")<br>
    ## States short labels for the sequences<br>
    bf.shortlab &lt;- c("P","L","M","LM","C","LC", "LMC", "D")<br>
    ## Building the sequence object<br>
    biofam.seq &lt;- seqdef(biofam[,10:25], states=bf.shortlab,
    labels=bf.labels)<br>
    ## Computing distance using Optimal matching with transition based
    substitution costs.<br>
    biodist &lt;- seqdist(biofam.seq, method="OM", sm="TRATE", indel=1)<br>
    <br>
    ## First solution : Use a discretized variable<br>
    ## The "cut" function creates a factor using the given cutting
    points<br>
    biofam$cohort &lt;- cut(biofam$birthyr, c(1900, 1930, 1940, 1950,
    1960), right=FALSE, <br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; labels=c("1900-1929", "1930-1939", "1940-1949",
    "1950-1959"))<br>
    ## Compute the association with this new variable<br>
    da &lt;- dissassoc(biodist, biofam$cohort, R=1000)<br>
    ## Printing results<br>
    ## Differences are highly significant <br>
    print(da)<br>
    <br>
    <br>
    ## Second solution : Use the tree procedure<br>
    ## It will automatically find the best binary splits<br>
    biotree &lt;- seqtree(biofam.seq~birthyr, data=biofam, diss=biodist)<br>
    <br>
    ##Printing the tree<br>
    print(biotree)<br>
    ## Displaying the tree (adjusting legend fontsize otherwise it's too
    big)<br>
    ## You will need to install GraphViz for this<br>
    seqtreedisplay(biotree, type="d", legend.fontsize=2)<br>
    <br>
    <br>
    ## Creating a new cohort covariate according to the splitting points
    found with the tree procedure<br>
    biofam$cohort2 &lt;- cut(biofam$birthyr, c(1900, 1929, 1941, 1947,
    1951, 1970), right=FALSE, <br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; labels=c("&lt;=1928", "1929-1940", "1941-1946",
    "1947-1950", "1951+"))<br>
    <br>
    ## Computing association with this new variable<br>
    da2 &lt;- dissassoc(biodist, biofam$cohort2, R=1000)<br>
    ## Printing results<br>
    ## Pseudo R2 is slightly higher than before<br>
    print(da2)<br>
    <br>
    Hope this helps.<br>
    <br>
    Matthias Studer<br>
    <br>
    <br>
    <br>
    Le 30.10.2011 02:04, Zuluaga, Juan a &eacute;crit&nbsp;:
    <blockquote
cite="mid:4B236621C4E4E943B7BB21F73014CD941F66DBA3@SCSU83A.campus.stcloudstate.edu"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      <meta name="Generator" content="Microsoft Word 14 (filtered
        medium)">
      <style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:"Consolas","serif";
        color:black;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Hello

            Traminer people, <o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">I
            read your Sociological Methods and Research paper. &nbsp;The
            McVicar and Anyadike-Danes (2002) dataset that you used has
            categorical covariates. <o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">How

            do you deal with quantitative variates? &nbsp;<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Thank

            you!<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">-juan

            zuluaga<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
        <p class="MsoNormal"><o:p>&nbsp;</o:p></p>
      </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>
    <br>
    <div style="bottom: auto; left: 188px; right: auto; top: 178px;
      display: none;" class="translator-theme-default"
      id="translator-floating-panel">
      <div title="Cliquer pour traduire"
        id="translator-floating-panel-button"></div>
    </div>
  </body>
</html>