<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    Hi Alexandre,<br>
    <br>
    No you should not have a % at the end since
    "contact[count.miss&gt;0, 2:4]" displays the input data, not the
    sequence object.<br>
    <br>
    To display the void elements in your sequence object, type<br>
    <br>
    print(contact.seq, extended=TRUE)<br>
    <br>
    By "the way your sequences are prepared" I mean that if one or
    several missing states (supposed to be NA's by default, but this can
    be overridden with "missing=" argument) are found in your input
    data, seqdef enters a data preparation stage. The way your missing
    values are handled in this stage is set with "left", "gaps" and
    "right" arguments. <br>
    <br>
    Have a look at the way seqdef is handling missing values by using
    the ex1 example data set:<br>
    <br>
    data(ex1)<br>
    ex1<br>
    seqdef(ex1, 1:13)<br>
    seqdef(ex1, 1:13, right=NA)<br>
    <br>
    All the best,<br>
    Alexis.<br>
    <br>
    Le 20. 04. 11 18:01, Alexandre Pollien a écrit :
    <blockquote cite="mid:4DAF0351.8000307@unil.ch" type="cite">Thank
      you for your answers Matthias and Alexis,
      <br>
      <br>
      Sorry but I still have a problem with the missings: I can not
      understand why my missings are not coded as void element. They are
      indeed located after the last valid state and I even tried to
      specify the default value right="DEL". I'm especially surprised
      because I made ​​this observation on old scripts that did not
      react like this before (I think... maybe I'm going mad?)
      <br>
      <br>
      Alexis, what do you mean by "the way your sequences are prepared"?
      I usually use csv file
      <br>
      <br>
      An exemple to be clearer:
      <br>
      <br>
      id,c1,c2,c3
      <br>
      21,8,1,
      <br>
      <br>
      --&gt; and import in TraMineR:
      <br>
      <br>
      <br>
      #########################
      <br>
      <br>
      library(TraMineR)
      <br>
      library(foreign)
      <br>
      <br>
      contact&lt;-read.csv("base.csv")
      <br>
      <br>
      names(contact)
      <br>
      [1] "id" "c1" "c2" "c3"
      <br>
      <br>
      contact.seq &lt;- seqdef(contact, 2:4, right="DEL")
      <br>
      [&gt;] found missing values ('NA') in sequence data
      <br>
      [&gt;] preparing 1 sequences
      <br>
      [&gt;] coding void elements with '%' and missing values with '*'
      <br>
      [&gt;] 2 distinct states appear in the data:
      <br>
      1 = 1
      <br>
      2 = 8
      <br>
      [&gt;] alphabet (state labels):
      <br>
      1 = 1 (1)
      <br>
      2 = 8 (8)
      <br>
      [&gt;] 1 sequences in the data set
      <br>
      [&gt;] min/max sequence length: 2/2
      <br>
      <br>
      count.miss &lt;- rowSums(is.na(contact[,2:4]))
      <br>
      <br>
      contact[count.miss&gt;0, 2:4]
      <br>
      c1 c2 c3
      <br>
      1 8 1 NA
      <br>
      <br>
      #########################
      <br>
      <br>
      Should I not have a % at the end ?
      <br>
      <br>
      <br>
      <br>
      Best (and beautifull easter)
      <br>
      <br>
      <br>
      Alexandre
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      Le 19.04.2011 12:00, <a class="moz-txt-link-abbreviated" href="mailto:traminer-users-request@r-forge.wu-wien.ac.at">traminer-users-request@r-forge.wu-wien.ac.at</a>
      a écrit :
      <br>
      <blockquote type="cite">Send Traminer-users mailing list
        submissions to
        <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>
        <br>
        To subscribe or unsubscribe via the World Wide Web, visit
        <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>
        <br>
        <br>
        or, via email, send a message with subject or body 'help' to
        <br>
            <a class="moz-txt-link-abbreviated" href="mailto:traminer-users-request@lists.r-forge.r-project.org">traminer-users-request@lists.r-forge.r-project.org</a>
        <br>
        <br>
        You can reach the person managing the list at
        <br>
            <a class="moz-txt-link-abbreviated" href="mailto:traminer-users-owner@lists.r-forge.r-project.org">traminer-users-owner@lists.r-forge.r-project.org</a>
        <br>
        <br>
        When replying, please edit your Subject line so it is more
        specific
        <br>
        than "Re: Contents of Traminer-users digest..."
        <br>
        <br>
        <br>
        Today's Topics:
        <br>
        <br>
            1. Re: The substitution cost matrix is not symmetric
        <br>
               (Alexis Gabadinho)
        <br>
        <br>
        <br>
----------------------------------------------------------------------
        <br>
        <br>
        Message: 1
        <br>
        Date: Mon, 18 Apr 2011 13:54:12 +0200
        <br>
        From: Alexis Gabadinho<a class="moz-txt-link-rfc2396E" href="mailto:Alexis.Gabadinho@unige.ch">&lt;Alexis.Gabadinho@unige.ch&gt;</a>
        <br>
        Subject: Re: [Traminer-users] The substitution cost matrix is
        not
        <br>
            symmetric
        <br>
        To: Users questions<a class="moz-txt-link-rfc2396E" href="mailto:traminer-users@r-forge.wu-wien.ac.at">&lt;traminer-users@r-forge.wu-wien.ac.at&gt;</a>
        <br>
        Message-ID:<a class="moz-txt-link-rfc2396E" href="mailto:4DAC2664.3090502@unige.ch">&lt;4DAC2664.3090502@unige.ch&gt;</a>
        <br>
        Content-Type: text/plain; charset=windows-1252; format=flowed
        <br>
        <br>
        Hi Alexandre,
        <br>
        <br>
        Regarding your second question, you have indeed missing values
        in your
        <br>
        data, since we can see in the output of seqdist that the length
        of your
        <br>
        sequences vary from 1 to 12.
        <br>
        <br>
        The way missing values (supposed to be NA's by default) are
        handled is
        <br>
        set in seqdef with the arguments "gaps", "left" and "right". By
        <br>
        default,  missing values found after the last valid state in a
        sequence
        <br>
        are coded as void elements, meaning that your sequence is
        supposed to
        <br>
        end with the last valid state. Thus if you have sequences of
        unequal
        <br>
        length, ending with NA'S , this is the way your sequences are
        prepared.
        <br>
        See user's guide for more information.
        <br>
        <br>
        To locate missing values in your data you can do for example:
        <br>
        <br>
        count.miss&lt;- rowSums(is.na(contact[,2:15]))
        <br>
        <br>
        This counts the number of missing values in each row of your
        original data.
        <br>
        <br>
        To display the rows containing at least one missing value:
        <br>
        <br>
        contact[count.miss&gt;0, 2:15]
        <br>
        <br>
        Best regards,
        <br>
        Alexis.
        <br>
        <br>
        Alexandre Pollien a ?crit :
        <br>
        <blockquote type="cite">Hello,
          <br>
          <br>
          When I use seqsubm, now I get this message:
          <br>
          <br>
          <blockquote type="cite">  contact.om&lt;-
            <br>
          </blockquote>
seqdist(contact.seq,method="OM",indel=2,sm=cout,with.missing=FALSE,
          <br>
          full.matrix=TRUE)
          <br>
          [&gt;] 5764 sequences with 9 distinct events/states
          <br>
          [&gt;] 496 distinct sequences
          <br>
          [&gt;] min/max sequence length: 1/12
          <br>
          [&gt;] computing distances using OM metric
          <br>
          [&gt;] total time: 1.25 secs
          <br>
          Message d'avis :
          <br>
          The substitution cost matrix is not symmetric.
          <br>
          <br>
          cout is computed with seqsubm (method="TRATE")
          <br>
          <br>
          <br>
          A surprising aspect is that it is not systematic (3 / 4)
          <br>
          <br>
          I thought of a problem of missing value
          <br>
          <br>
          <br>
          Another amazing prompt is that seqdef shows this message:
          <br>
          <blockquote type="cite">  contact.seq&lt;- seqdef(contact,
            2:15, states = contact.shortlab,labels
            <br>
          </blockquote>
          = contact.lab)
          <br>
          [&gt;] found missing values ('NA') in sequence data
          <br>
          <br>
          ...even when there is no missing in my data! (How can I seethe
          <br>
          sequence containing the missing data?)
          <br>
          <br>
          <br>
          Does anyone have a idea?
          <br>
          <br>
          Thank you very much
          <br>
          <br>
          Best regards and good weekend
          <br>
          <br>
          Alexandre
          <br>
          <br>
          <br>
          <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>
          <br>
          <br>
        </blockquote>
        <br>
        <br>
        ------------------------------
        <br>
        <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>
        <br>
        <br>
        <br>
        End of Traminer-users Digest, Vol 9, Issue 3
        <br>
        ********************************************
        <br>
        <br>
      </blockquote>
      <br>
      <br>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
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>