|
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: Data Expansion Question
Dear Statalist,
I have a question regarding the expansion of a cross-sectional
time-series dataset that I am working with. Basically, I have cases
with an indicator of the duration of the case in years. I would like to
expand this data out so that there is a separate observation for each
year that the case existed. I would also like to include a count of
which year the case is in, and a year variable tracking the year. Could
anybody help me with the creation of a simple do file that would expand
the data?
This is the way the original data looks:
Unique case identifier duration count year many
additional variables
1 4 1 1990 x
2 3 1 1995 x
.
.
.
I want to expand the data to look like this:
Unique case identifier duration count year many
additional variables
1 4 1 1990 x
1 4 2 1991 x
1 4 3 1992 x
1 4 4 1993 x
2 3 1 1995 x
2 3 2 1996 x
2 3 3 1997 x
Thanks for any help that you can provide,
David
David Lektzian
Assistant Professor
Department of Political Science
Texas Tech University
113 Holden Hall Boston & Akron Streets
Lubbock, Texas 79409-1015
Phone: 806-742-3121
Fax: 806-742-0850
*
* 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/