Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: Extend observations in dataset
From
"Peter Bilfiger" <[email protected]>
To
[email protected]
Subject
st: Extend observations in dataset
Date
Tue, 28 Jan 2014 15:37:39 +0100 (CET)
I have the following dataset:
Number Year Other variable of interest
11111 1999 5
Now, I want to extend the observations so that it looks like this:
Number Year Other variable of interest
11111 1999 5
11111 2000 .
11111 2001 .
11111 2002 .
11111 1998 .
11111 1997 .
11111 1996 .
Basically extend the years by +3 and -3 and just copy the number so that for each year, there is the same number from the initial year. The other variables are not important. They can be missing.
Can anybody help?
Thank you.
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/