[Traminer-users] Problems passing/using group command

Alexis Gabadinho Alexis.Gabadinho at unige.ch
Wed Sep 19 10:07:54 CEST 2012


Hi Michael,

Indeed, the solution is to first transform your spell data into the sts 
format using seqformat and then to merge it with the demographic data. 
Otherwise you get the error message since you pass as group argument a 
vector that contains much more rows than the number of sequences in your 
sequence object.

Alexis


Le 19. 09. 12 08:33, Hadrien Commenges a écrit :
> Hi Michael,
>
> I think you don't have to merge your demographic data with your 
> states/events data, it seems to me that it's the source of your 
> problem. For my part, I always work with two objects: the state/event 
> object (sts object) and a dataframe with individual's id and 
> variables. Try to convert your spell data without the status variable 
> (educ4), and to get your individual's data in a separate dataframe. 
> Then you can try :
>
> seqiplot(data.seq, group = individuals$group, ...)
>
> Hope it helps.
>
> Hadrien
>
> ------------------------------------------------------------------------
> *De: *"Michael Corey" <michael.corey at gmail.com>
> *À: *Traminer-users at lists.r-forge.r-project.org
> *Envoyé: *Mercredi 19 Septembre 2012 02:17:05
> *Objet: *[Traminer-users] Problems passing/using group command
>
> Hi All,
>
>
> I'm having a problem using the group function in TraMineR. I have a 
> data set that contains SPELL data, so multiple rows per case. I also 
> have demographic data per case, at one row per case. I merge these 
> together and end up with data that has a demographic covariate per 
> row, so multiple rows per case. An example of this data would be:
>
> |id startmin stopmin activity educ4
>
> 4       1       20        work    HS
>
> 4       20      40        play    HS
>
> 8       1       15        sleepCollege
>
> 8       15      40        workCollege
>
> |
>
> I can make sequence data from this, but when I try to run a plot using 
> the group command
>
> |       seqiplot(atus.seq,  group  =  atus.seqdata$educ4,  border=NA,  
>
>                 withlegend="right",   cex.plot=.55)
>
> |
>
> it tells me:
>
> |     >"Error: group must contain one value for each row in the sequence object".
>
> |
>
> I have gotten this to work with the example of the mvad data in the 
> training manual, but I can't seem to get it to work with the groups, 
> whether I link to the original demographic data, the merged data, or 
> try to pass the covariates by seqformat and seqdef. Ideas?
>
> Thanks,
>
> Michael
>
>
> _______________________________________________
> 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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/traminer-users/attachments/20120919/65b91a5c/attachment.html>


More information about the Traminer-users mailing list