I would be most grateful for some help with the syntax for reshaping
data from wide to long. I have not previously used the reshape and stack
commands much so i am unfamiliar with them.
Basically what i trying to do is stack/reshape the following variables,
x[i]y[j]z[k] where i={1,3}, j={1,2} and k={1,2,3,4,5,6}. These are
variables which reference crop values in season (x), plot (y) and
croptype (z).
So if the data looks something like this:
id X1Y1Z1 X1Y1Z2 X1Y2Z1 X2Y1Z5 X2Y2Z6
1 10 20 30 40 50
2 10 20 30 40 50
.....
and i am trying to get to this:
id season plot crop value
1 1 1 1 10
1 1 1 2 20
1 1 2 1 30
1 2 1 5 40
1 2 2 6 50
2 1 1 1 10
2 1 1 2 20
2 1 2 1 30
2 2 1 5 50
etc....
Thanks
Pradeep
------------------------------------------------------------
Pradeep Kurukulasuriya
Yale University -School of Forestry and Environment
Email: [email protected]
Tel/fax: 718-623 0835 (home)
Mobile: 718 938 9965
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/