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]

st: Suggestion for Reshape


From   Elena Quercioli <elena.liquorice@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: Suggestion for Reshape
Date   Fri, 17 Sep 2010 11:28:10 +0200

Hello,

My data is organized in an Excel source file as I explain here, below:


SOURCE EXCEL FILE

                     yr_1      yr_2       yr_3   ...      yr_9

County_1    x1_11   x1_12    x1_13   ...  x1_19
                     x2_11   x2_12    x2_13   ...  x2_19
           .   .   .    ...  .
                     x5_11   x5_12  x5_13   ...  x5_19
County_2     x1_21   x1_22  x1_23   ...  x1_29
                     x2_21   x2_22  x2_23   ...  x2_29
                    .   .   .    ...  .
                     x5_21  x5_22  x5_23   ...  x5_29
.
.
.
County_8  (same 5X9 matrix but for County 8)

where x1_{ij} will eventually be the independent variable in a fixed
effects (panel) regression

the DESIRED "LONG" STATA FORM is

countyid  yr  x1  x2  x3  x4  x5

with  7  columns  and  9*8 rows.

I cannot figure out how to use the "reshape" command to get to my
desired Stata form. Can someone please assist me with this?

Thank you for all you help in advance!

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