[Traminer-users] création d'une séquence à partir d'un format SPELL
Chris Cameron
cjc73 at cornell.edu
Tue Apr 3 23:37:06 CEST 2012
I think you need to also specify the status variable:
> cv.seq <- seqdef(cv, var=c("idcv", "start", "end", "status"), informat="SPELL", id = "idcv", begin = "start", end = "end", status='status' )
If that does not work, pages 42-43 of the TraMineR 1.4 Users manual explains how to deal with a status in factor format and convert to STS as suggested by Hadrian.
On Apr 3, 2012, at 1:00 PM, Guillaume Ollivier wrote:
> Bonjour,
>
> Je cherche à créer un seq à partir de données de CV formatées en SPELL.
> str(cv) :
> 'data.frame': 444 obs. of 12 variables:
> $ idcv : num 8.04e+13 8.04e+13 8.04e+13 8.04e+13 8.04e+13 ...
> $ start : int 1989 1993 1994 1994 1995 1996 1997 1997 1998 1999 ...
> $ end : int 1994 1994 1994 1997 1997 1996 1999 1999 2004 2009 ...
> $ status : Factor w/ 7 levels "","academy","company",..: 1 1 1 1 7 7 1 1 2 1 ...
> $ nome_completo : Factor w/ 49 levels "Adriano Arriel Saquet",..: 30 30 30 30 30 30 30 30 30 30 ...
> $ ano_nascimento: int 1972 1972 1972 1972 1972 1972 1972 1972 1972 1972 ...
> $ sexo : Factor w/ 2 levels "Feminino","Masculino": 2 2 2 2 2 2 2 2 2 2 ...
> $ etat : Factor w/ 17 levels "","AC","AM","BA",..: 16 16 16 16 16 16 16 16 16 16 ...
> $ pais : Factor w/ 2 levels "","Brasil": 2 2 2 2 2 2 2 2 2 2 ...
> $ duree_parcours: num 23 23 23 23 23 23 23 23 23 23 ...
> $ ano_mini : num 1989 1989 1989 1989 1989 ...
> $ denschaves : num 0.564 0.564 0.564 0.564 0.564 ...
> ----------------
>
> Pour cela j’utilise la fonction seqdef où je spécifie la localisation de la variable status dans lequel il y a des données manquantes:
> cv.seq <- seqdef(cv, var=c("idcv", "start", "end", "status"), informat="SPELL", id = "idcv", begin = "start", end = "end")
>
>
> mais R me renvoie le message suivant :
> [>] SPELL data converted into 49 STS sequences
> [>] found missing values ('NA') in sequence data
> [>] preparing 49 sequences
> [>] coding void elements with '%' and missing values with '*'
> [!] sequence with index: 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49 contains only missing values.
> This may produce inconsistent results.
> [>] 0 distinct states appear in the data:
> 1 = NA
> 0 =
> [>] alphabet (state labels):
> 1 = NA (NA)
> 0 = ()
> [>] 49 sequences in the data set
> [>] min/max sequence length: 100/100
> -------------
>
> Il semble que l’opération de conversion bloque ce que confirme l’examen de l’objet cv.seq qui ne contient que des données manquantes. R ne reconnait visiblement pas la variable status et les différents états qu’elle est censée contenir.
> Pourriez-vous me donner des pistes pour solutionner ce problème
>
> Bien cordialement
>
> Guillaume Ollivier
> INRA
> Plateformes AMAnDeS.Txt
> "Appui Méthodologique en Analyse des Données Sociologiques et Textuelles"
> UR 0767 Ecodéveloppement
> Agroparc, 84914 Avignon cedex 9
> tel : 0432722579
> http://www4.paca.inra.fr/ecodeveloppement/Plateforme-Amandes.txt
>
> _______________________________________________
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/traminer-users/attachments/20120403/5b267447/attachment.html>
More information about the Traminer-users
mailing list