Bookmark and Share

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]

Re: st: Extend observations in dataset


From   Nick Cox <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re: st: Extend observations in dataset
Date   Tue, 28 Jan 2014 16:18:56 +0000

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
[email protected]


On 28 January 2014 15:22, Torsten Häberle <[email protected]> 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 <[email protected]>:
>> 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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index