Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: generate observations by group/levels- aplologies if this message appears more than once -


From   "Rajesh Tharyan" <[email protected]>
To   <[email protected]>
Subject   st: generate observations by group/levels- aplologies if this message appears more than once -
Date   Sun, 20 May 2007 15:45:55 +0100

Hi all,


I am trying the do the following. If I have a data set which looks like this

Co� ��year
A���� �1986
A����� 1999
B����� 1987

I want to say increase the observations for each company year by any number
of years I specify. Lets assume expanding by two years.

So the resulting dataset will look like

Co year

A 1986
A 1987
A 1988
A 1999
A 2000
A 2001
B 1987
B 1988
B 1989

I cant set obs or expand by a grouping variable.� I was then trying to split
each file into several files first based on levels of co and then levels of
year, then expand , fillinin missing values etc. But that route is making
the process unnecessarily complicated (I think)

Is there a more staright forward way to do this

Any help is valuable

Thanks
rajesh



*
*   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