Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Reshaping data question


From   Glenn Hoetker <[email protected]>
To   [email protected]
Subject   st: Reshaping data question
Date   Mon, 7 Apr 2008 21:27:06 -0500



I have data in a layout that is new to me and I'm stuck on how to reshape it to what I need. Worse, I feel like I'm missing something obvious. Any help would be much appreciated.

The data is in this layout (with fictional data)

COUNTRY DATA_SERIES YR1960 YR1961 YR1962
Argentina GDP 5 7 9
Argentina Population 10 8 5
Brazil GDP 1 9 10
Brazil Population 5 35 12

I would like to get it into this format:

COUNTRY YEAR GDP POPULATION
Argentina 1960 5 10
Argentina 1961 7 8
...
Brazil 1960 1 5
Brazil 1961 9 35
etc.

It's the "DATA_SERIES" variable in the original data that is really throwing me. I'm fairly comfortable with plain vanilla "reshape". Thank you in advance for any help.

Glenn Hoetker
Glenn Hoetker
Associate Professor (Business, Law, Institute for Genomic Biology)
Resident Associate, Center for Advanced Study, Science and Technology in the Pacific Century (STIP) initiative
Faculty Fellow, Academy for Entrepreneurial Leadership
University of Illinois
217-265-4081
[email protected]
Personal website: www.business.uiuc.edu/ghoetker
Science & Technology in the Pacific Century initiative website: www.business.uiuc.edu/stip

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




© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index