[Traminer-users] Traminer-users Digest, Vol 9, Issue 3

Alexandre Pollien alexandre.pollien at fors.unil.ch
Wed Apr 20 18:01:21 CEST 2011


Thank you for your answers Matthias and Alexis,

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?)

Alexis, what do you mean by "the way your sequences are prepared"? I 
usually use csv file

An exemple to be clearer:

id,c1,c2,c3
21,8,1,

--> and import in TraMineR:


#########################

library(TraMineR)
library(foreign)

contact<-read.csv("base.csv")

names(contact)
[1] "id" "c1" "c2" "c3"

contact.seq <- seqdef(contact, 2:4, right="DEL")
[>] found missing values ('NA') in sequence data
[>] preparing 1 sequences
[>] coding void elements with '%' and missing values with '*'
[>] 2 distinct states appear in the data:
1 = 1
2 = 8
[>] alphabet (state labels):
1 = 1 (1)
2 = 8 (8)
[>] 1 sequences in the data set
[>] min/max sequence length: 2/2

count.miss <- rowSums(is.na(contact[,2:4]))

contact[count.miss>0, 2:4]
c1 c2 c3
1 8 1 NA

#########################

Should I not have a % at the end ?



Best (and beautifull easter)


Alexandre






Le 19.04.2011 12:00, traminer-users-request at r-forge.wu-wien.ac.at a écrit :
> Send Traminer-users mailing list submissions to
> 	traminer-users at lists.r-forge.r-project.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> 	https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/traminer-users
>
> or, via email, send a message with subject or body 'help' to
> 	traminer-users-request at lists.r-forge.r-project.org
>
> You can reach the person managing the list at
> 	traminer-users-owner at lists.r-forge.r-project.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Traminer-users digest..."
>
>
> Today's Topics:
>
>     1. Re: The substitution cost matrix is not symmetric
>        (Alexis Gabadinho)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 18 Apr 2011 13:54:12 +0200
> From: Alexis Gabadinho<Alexis.Gabadinho at unige.ch>
> Subject: Re: [Traminer-users] The substitution cost matrix is not
> 	symmetric
> To: Users questions<traminer-users at r-forge.wu-wien.ac.at>
> Message-ID:<4DAC2664.3090502 at unige.ch>
> Content-Type: text/plain; charset=windows-1252; format=flowed
>
> Hi Alexandre,
>
> Regarding your second question, you have indeed missing values in your
> data, since we can see in the output of seqdist that the length of your
> sequences vary from 1 to 12.
>
> The way missing values (supposed to be NA's by default) are handled is
> set in seqdef with the arguments "gaps", "left" and "right". By
> default,  missing values found after the last valid state in a sequence
> are coded as void elements, meaning that your sequence is supposed to
> end with the last valid state. Thus if you have sequences of unequal
> length, ending with NA'S , this is the way your sequences are prepared.
> See user's guide for more information.
>
> To locate missing values in your data you can do for example:
>
> count.miss<- rowSums(is.na(contact[,2:15]))
>
> This counts the number of missing values in each row of your original data.
>
> To display the rows containing at least one missing value:
>
> contact[count.miss>0, 2:15]
>
> Best regards,
> Alexis.
>
> Alexandre Pollien a ?crit :
>> Hello,
>>
>> When I use seqsubm, now I get this message:
>>
>>>   contact.om<-
>> seqdist(contact.seq,method="OM",indel=2,sm=cout,with.missing=FALSE,
>> full.matrix=TRUE)
>> [>] 5764 sequences with 9 distinct events/states
>> [>] 496 distinct sequences
>> [>] min/max sequence length: 1/12
>> [>] computing distances using OM metric
>> [>] total time: 1.25 secs
>> Message d'avis :
>> The substitution cost matrix is not symmetric.
>>
>> cout is computed with seqsubm (method="TRATE")
>>
>>
>> A surprising aspect is that it is not systematic (3 / 4)
>>
>> I thought of a problem of missing value
>>
>>
>> Another amazing prompt is that seqdef shows this message:
>>>   contact.seq<- seqdef(contact, 2:15, states = contact.shortlab,labels
>> = contact.lab)
>> [>] found missing values ('NA') in sequence data
>>
>> ...even when there is no missing in my data! (How can I seethe
>> sequence containing the missing data?)
>>
>>
>> Does anyone have a idea?
>>
>> Thank you very much
>>
>> Best regards and good weekend
>>
>> Alexandre
>>
>>
>>
>> _______________________________________________
>> Traminer-users mailing list
>> Traminer-users at lists.r-forge.r-project.org
>> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/traminer-users
>>
>
>
> ------------------------------
>
> _______________________________________________
> Traminer-users mailing list
> Traminer-users at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/traminer-users
>
>
> End of Traminer-users Digest, Vol 9, Issue 3
> ********************************************
>


-- 
_______________________

Alexandre Pollien
FORS - Swiss foundation for research in social sciences
c/o University of Lausanne – Vidy
Route de Chavannes 33
CH - 1015 Lausanne

Switzerland

Tel.: +41 21 692 37 39

alexandre.pollien at fors.unil.ch
http://www.fors.unil.ch
_______________________

-------------- next part --------------
A non-text attachment was scrubbed...
Name: alexandre_pollien.vcf
Type: text/x-vcard
Size: 400 bytes
Desc: not available
URL: <http://lists.r-forge.r-project.org/pipermail/traminer-users/attachments/20110420/60f7b133/attachment.vcf>


More information about the Traminer-users mailing list