[Traminer-users] création d'une séquence à partir d'un format SPELL

Hadrien Commenges hc at parisgeo.cnrs.fr
Tue Apr 3 22:14:11 CEST 2012


Hi, 

waiting for an answer from the package's managers or from other users, I can give you some leads. First you should try with another format for your status variable (currently it's a factor), character or numeric vector. If it doesn't work you should try with the seqformat function (from="SPELL", to="STS"). If it doesn't work and if there is no better option from other users I can give you a script I made to convert SPELL format into STS format (I wrote it because I needed to deal with specific problems with my data). 

Hadrien 

----- Mail original -----

De: "Guillaume Ollivier" <gollivier at avignon.inra.fr> 
À: traminer-users at r-forge.wu-wien.ac.at 
Envoyé: Mardi 3 Avril 2012 19:00:30 
Objet: [Traminer-users] création d'une séquence à partir d'un format SPELL 



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/e99c967d/attachment-0003.html>


More information about the Traminer-users mailing list