[Traminer-users] Date format with SPELL

Gilbert Ritschard Gilbert.Ritschard at unige.ch
Mon Nov 17 11:52:49 CET 2014


Dear Julien

TraMineR does not support the date format. The begin and end arguments in seqformat (and seqdef) should be integer variables. In your case you should transform the dates into numbers of days (see http://stackoverflow.com/questions/19564930/how-do-i-convert-date-to-number-of-days-in-r ). you may also want to have a look at this related question on SO: http://stackoverflow.com/questions/11801511/using-time-diary-data-with-traminer

In addition, we recommend to first transform your SPELL data into STS form with seqformat and then input the STS form into seqdef.

Best.
Gilbert

From: traminer-users-bounces at lists.r-forge.r-project.org [mailto:traminer-users-bounces at lists.r-forge.r-project.org] On Behalf Of Julien Bourdais
Sent: Monday, November 17, 2014 10:09
To: traminer-users at lists.r-forge.r-project.org
Subject: [Traminer-users] Date format with SPELL

Dear Traminer's users,



I guess my question is typically the one of a begginer on Traminer. I've been collecting a list of stays that some people did in a hospital. The beginning and end dates of each stay are rather precise (dd/mm/yyyy) and I'd like to stick to that precision for the moment. Although, in the user's guide and the Traminer's mailing list I couldn't find any example where the beginning and the end of the spell are written in a date format (not just as a year).

  I supp

os

e Traminer do not support the date format. Every time I try to define a sequence object I receive this message :



> SEJ.seq <- seqdef(sej, id="ID", begin="entree", end="sortie", status="sejour_type", fillblanks=NA, informat="SPELL", states=sej.states, labels=sej.labels, process=FALSE)



Error in Summary.factor(c(NA_integer_, NA_integer_, NA_integer_, NA_integer_,  :

  min not meaningful for factors

In addition: Warning messages:

1: In Ops.factor(begincolumn, 1) : < not meaningful for factors

2: In Ops.factor(endcolumn, begincolumn) : - not meaningful for factors

3: In Ops.factor(begincolumn, 0) : > not meaningful for factors



Here is a sample of my data :


ID

sejour_type

entree

sortie

1

Temps plein

06/06/2013

19/03/2014

1

Temps plein

10/05/2010

16/05/2013

2

Temps plein

19/01/2012

27/01/2012

2

Temps plein

01/02/2011

04/08/2011

3

Temps plein

21/02/2013

19/03/2014

7

Hôpital de jour

18/09/2014

12/11/2014


Am I right thinking that the date format is the problem or does it rely somewhere else ?

Kindly yours,

Julien

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/traminer-users/attachments/20141117/80d94758/attachment-0001.html>


More information about the Traminer-users mailing list