Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: sequence analysis

From   Melanie Spallek <>
To   "" <>
Subject   st: sequence analysis
Date   Thu, 5 Jan 2012 20:09:55 +1000

Hi, I'm trying to do a sequence analysis using housing trajectories (tenure status). I'm using sqset tenure id wave, trim to define my sequences. Followed by seqtab, so, I receive a frequency table of the sequences, however the so option treats identically all sequences that have the same order of elements; i.e., the sequence A-B-B-A would be treated the same as A-B-A-A, which is exactly what I want.  My first (and most important) question is if and how I can save those sequences in a variable. Since my dataset is in long format, I'm aware that by having ten waves for each id, the 'sequence variable' will be occurring ten times, which is ok. 
My second question is the following. I have used the keeplongest option to define the sequences, and when every time I run exactly the same code followed by seqtab, I get slightly different results. I'm thinking that this might be due to STATA randomly selecting  different consecutive sequences, eg, A-A-A-.-.-.-B-B-B, so if I run it once, keeplongest might select the A-A-A sequence, and the next time it might select the B-B-B sequence, as both are the same length, and hence I get slightly different frequencies for the A-A-A and B-B-B sequencies....Has anybody got any other explanation???
Any help would be greatly appreciated.

Thanks, Melanie.

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index