Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: identify group of observations


From   "MITRA PINAKI (MAR1PXM)" <[email protected]>
To   [email protected]
Subject   st: identify group of observations
Date   Wed, 28 Apr 2004 18:08:49 -0400

Hello List,

I have a data set where I need to group observations. The identifying flag
is two character string which can be either "01" or "02". Each "01"
observation is followed by "02", so the flag for the first obs is "01" and
the very next one's is "02". But these are always not in pair; order can be
"01" and "02"; "01", "02", "02"; "01", "02", "02, "02" and so on. All the
"02" obs. followed by "01" belong to one group. Is there any way I can
generate an identifier that indicates these groups?    

Any help will be greatly appreciated.


Sincerely,

Pinaki Mitra   
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index