Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Panel data variable transpose help


From   Nick Cox <njcoxstata@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Panel data variable transpose help
Date   Tue, 3 Apr 2012 16:45:14 +0100

. help reshape

On Tue, Apr 3, 2012 at 4:10 PM, Dangol, Ramesh <rdangol@bsu.edu> wrote:
> Hi everyone,
>
> I have a panel data set separated by "ITEM_id", year and FIRM_ID.  I would like to transpose the "ITEM_PER" variable into rows (by year and firm name) and fill in the corresponding rows in the following manner. I also would like to retain the column variable "P_PER".  What would be easiest way to achieve this?
>
> ITEM_ID    year    Firm_ID      P_PER         ITEM1    TIEM2   TIEM3
> ITEM1        2002     1                  X                     X              Y             Z
> ITEM2       2002           1            Y                      X              Y             Z
> TIME3       2002           1            Z                      X              Y             Z
>
> ITEM1        2003     1                  X                     X              Y             Z
> ITEM2       2003           1            Y                      X              Y             Z
> TIME3       2003           1            Z                      X              Y             Z
>
> ITEM11       2003     2                  X                     X              Y             Z
> ITEM12        2003          2           Y                      X              Y             Z
> TIME12       2003           2           Z                      X              Y             Z
>

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


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index