[Traminer-users] plots with group option vs separate plots

Gilbert Ritschard Gilbert.Ritschard at unige.ch
Mon Mar 24 16:14:30 CET 2014


Hi Pierre,

It would be more useful to get help if you would provide the code you are using to generate your state sequence object.

My guess is that you created your state sequence object by passing a table with 41 columns (the last 20 ones containing perhaps only NA's). Assuming your sequence data are in columns 1 to 21 of a data frame named data, a solution would be to use something like seqdef(data[,1:21]).

If your state sequence object is data.seq, you can use seqiplot(data.seq[,1:21]) to plot only the first 21 columns. Fixing the seqdef problem is preferable however.

Best.
Gilbert


From: traminer-users-bounces at lists.r-forge.r-project.org<mailto:traminer-users-bounces at lists.r-forge.r-project.org> [mailto:traminer-users-bounces at lists.r-forge.r-project.org] On Behalf Of Pierre Blavier
Sent: Sunday, March 23, 2014 18:02
To: Users questions
Subject: Re: [Traminer-users] plots with group option vs separate plots

Hi everybody,

here is a plot from the TramineR seqiplot command. It gives the first 10 sequences of my dataset, all my sequences are 21 period-long. Does anyone know how to reduce the length of the x-axis to have a length of the longest sequence, i.e. 21 periods ? It's probably simple but i could not fix it. I have the same problems for other plots

Thanks, Best,

Pierre



[Image removed by sender.]


2014-01-15 16:35 GMT+01:00 Gilbert Ritschard <Gilbert.Ritschard at unige.ch<mailto:Gilbert.Ritschard at unige.ch>>:
Hi Jeremy,

Thank you for your question. Could you provide a reproducible working example? Indeed you are right, you should get the same plot in both cases. You do not provide enough information, however, to allow identifying the source of the problem.

Your question certainly is of interest for many TraMineR users and future users.  I would therefore suggest you post your question on StackOverflow (see http://mephisto.unige.ch/traminer/contrib.shtml) using the "traminer" tag which is searchable, unlike this r-forge list.

Best.
Gilbert



From: traminer-users-bounces at lists.r-forge.r-project.org<mailto:traminer-users-bounces at lists.r-forge.r-project.org> [mailto:traminer-users-bounces at lists.r-forge.r-project.org<mailto:traminer-users-bounces at lists.r-forge.r-project.org>] On Behalf Of Jeremy Reynolds
Sent: Monday, January 13, 2014 22:09
To: traminer-users at lists.r-forge.r-project.org<mailto:traminer-users at lists.r-forge.r-project.org>
Subject: [Traminer-users] plots with group option vs separate plots

Hello,
I have been making sequence plots, and I seem to be getting very different results when I use the "group" option of the seqdplot or seqIplot command than when I draw separate plots for each subgroup.
After creating a sequence object and performing optimal matching using PAM, I have chosen a 4 cluster solution.  I then create a single plot that shows the distribution across states in each of the 4 clusters like this:

seqdplot(seq.hc, group = pam5vs$clustering$cluster4, border = NA, title="pam5vs")
If I subset the data and make a separate plot for one of the 4 clusters as in the code below, the N matches the results above (the total N and the N across the states), but I get a very different impression of how the cases are distributed across the states in the two graphs.  Am I doing something wrong?  I would be happy to provide more detail if needed.
Thanks,

Jeremy

cluster4 <- subset(bhps, pam5vs$clustering$cluster4==(6875))
seq.cluster4 <- seqdef(cluster4 [4:21], labels = c("M", "S", "F", "O", "U" ))
seqdplot(seq.cluster4, border = NA, title="pam5vs cluster 6875")

--
********************
Dr. Jeremy Reynolds
Associate Professor
Undergraduate Coordinator
Department of Sociology
116 Baldwin Hall
University of Georgia
Athens, GA 30602-1611
Phone: (706) 583-8072<tel:%28706%29%20583-8072>
Web: http://uga.edu/soc/people/faculty/reynolds_jeremy.php
Fax: (706) 542-4320<tel:%28706%29%20542-4320>

_______________________________________________
Traminer-users mailing list
Traminer-users at lists.r-forge.r-project.org<mailto: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/20140324/06871137/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ~WRD000.jpg
Type: image/jpeg
Size: 823 bytes
Desc: ~WRD000.jpg
URL: <http://lists.r-forge.r-project.org/pipermail/traminer-users/attachments/20140324/06871137/attachment-0001.jpg>


More information about the Traminer-users mailing list