Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | miriam geringer <miriam.geringer@gmail.com> |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: st: Extend observations in dataset |
Date | Tue, 28 Jan 2014 17:59:51 +0100 |
Sorry, we are different people, working on the same project with a single desktop. Got some confusion here. 2014-01-28 Nick Cox <njcoxstata@gmail.com>: > Unless I am misunderstanding something, you appear to be posting as > > Miriam Geiringer > Peter Bilfiger > Torsten Häberle > > Precisely one identity is enough. Masquerading as somebody else is a > breach of trust. > > > > > Nick > njcoxstata@gmail.com > > > On 28 January 2014 15:22, Torsten Häberle <haeberle.torsten@gmail.com> wrote: >> I forgot to mention: >> 11111 is the very last observation at the end of the dataset. The >> extension should only be done to this very last observation. >> >> Example: >> >> Number Year Other variable of interest >> 77777 1975 9 >> 22222 1972 8 >> 11111 1999 5 >> >> >> Extension to: >> >> Number Year Other variable of interest >> 77777 1975 9 >> 22222 1972 8 >> 11111 1999 5 >> 11111 2000 . >> 11111 2001 . >> 11111 2002 . >> 11111 1998 . >> 11111 1997 . >> 11111 1996 . >> >> All the observations before should not be extended. They stay exactly >> the same. Only the very last one (11111 in our case). >> >> 2014-01-28 Peter Bilfiger <peter_bilfiger@web.de>: >>> 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? > > * > * 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/ * * 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/