[Traminer-users] Date format with SPELL
Gilbert.Ritschard at unige.ch
Mon Nov 17 11:52:49 CET 2014
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.
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).
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 :
Hôpital de jour
Am I right thinking that the date format is the problem or does it rely somewhere else ?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Traminer-users