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

st: generating sums


From   Rich Prisinzano <prisinz@eco.utexas.edu>
To   statalist@hsphsun2.harvard.edu
Subject   st: generating sums
Date   Sat, 17 Aug 2002 15:39:49 -0500 (Central Daylight Time)

I have a data that looks like this:

_obs_  _x_ _y_
 1	1   0
 2	1   0
 3	0   1
 4      0   1
 5	1   0
 6      0   1
 7	0   1

I want to generate a 'streak' variable that will make the data look like
this:

_obs_  _x_ _y_ _z_ _z2_
 1	1   0	1   0
 2	1   0   2   0
 3	0   1   0   1
 4      0   1   0   2
 5	1   0   1   0
 6      0   1   0   1
 7	0   1   0   2

Does anyone have a suggestion? 

Thanks

Rich


-------------------
Richard Prisinzano
Graduate Student
Department of Economics
University of Texas
prisinz@eco.utexas.edu
http://www.eco.utexas.edu/graduate/Prisinzano/

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index