Fabian,
I don't know if there's a better way of doing this, but an easy solution is just to use reshape, like Martin suggested, and then merge both datasets by last name.
Best,
Adrian
> Date: Sat, 20 Sep 2008 21:32:56 +0200
> From: [email protected]
> Subject: Re: st: Re: transform observations in variables
> To: [email protected]
>
> Dear Martin,
>
> Thank you for your help (I corrected the mistakes) but I think reshape is not the right command in my case because I have other data-items in the dataset where I don't want to change the shape (or destroy the allocation).
>
> So I am looking for a solution to copy observations of "size" in the columns (with a loop?) for each "familyname".
>
> Thanks,
> Fabian
>
>
>
>
> Martin Weiss schrieb:
>> -h reshape-
>>
>> HTH
>> Martin
>> _______________________
>> ----- Original Message ----- From: "Fabian Brenner"
>> To:
>> Sent: Saturday, September 20, 2008 8:38 PM
>> Subject: st: transform observations in variables
>>
>>
>>> Dear statalist:
>>>
>>> My data look like the following:
>>>
>>> "familiyname" "period" "size" "period1" "period2" "period3"
>>>
>>> AA 1 8
>>> AA 2 7
>>> AA 3 3
>>>
>>> AB 1 2
>>>
>>> BG 1 4
>>> BG 2 6
>>>
>>> For each "familyname" I want to get the values of "size" in the column with the equivalent "period" (1 to 3). The values of "size" should be written in the column of the equivalent period for all observations of the same "familyname" (that is why I wasn't able to manage it with -if-)
>>>
>>> The result should be:
>>>
>>> "familiyname" "period" "size" "period1" "period2" "period3"
>>>
>>> AA 1 8 8 7 3
>>> AA 2 7 8 7 3
>>> AA 3 3 8 7 3
>>>
>>> AB 1 2 2
>>>
>>> BG 1 4 4 6
>>> BG 2 6 4 6
>>>
>>> I hope someone has a solution or an idea to solve this problem. Thanks in advance!
>>> Fabian
>>>
>>> --
>>> GMX Kostenlose Spiele: Einfach online spielen und Spaß haben mit Pastry Passion!
>>> http://games.entertainment.gmx.net/de/entertainment/games/free/puzzle/6169196
>>> *
>>> * For searches and help try:
>>> * http://www.stata.com/help.cgi?search
>>> * http://www.stata.com/support/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/statalist/faq
>> * http://www.ats.ucla.edu/stat/stata/
>>
>
> --
> GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen!
> Jetzt dabei sein: http://www.shortview.de/wasistshortview.php?mc=sv_ext_mf@gmx
> *
> * For searches and help try:
> * http://www.stata.com/help.cgi?search
> * http://www.stata.com/support/statalist/faq
> * http://www.ats.ucla.edu/stat/stata/
________________________________
Get more out of the Web. Learn 10 hidden secrets of Windows Live. Learn Now
_________________________________________________________________
See how Windows Mobile brings your life together—at home, work, or on the go.
http://clk.atdmt.com/MRT/go/msnnkwxp1020093182mrt/direct/01/
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/