Statalist


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

st: Re: reshape world development indicators dataset


From   Kit Baum <[email protected]>
To   [email protected]
Subject   st: Re: reshape world development indicators dataset
Date   Wed, 2 Apr 2008 07:06:48 -0400

The care and feeding of the WDI dataset, using -reshape-, is described in

@Article{RePEc:tsj:stataj:v:7:y:2007:i:2:p:268-271,
author={Christopher F Baum and Nicholas J. Cox},
title={Stata tip 45: Getting those data into shape},
journal={Stata Journal},
year=2007,
volume={7},
number={2},
pages={268-271},
month={June},
url={http://ideas.repec.org/a/tsj/stataj/v7y2007i2p268-271.html}
}


Kit Baum, Boston College Economics and DIW Berlin
http://ideas.repec.org/e/pba1.html
An Introduction to Modern Econometrics Using Stata:
http://www.stata-press.com/books/imeus.html


On Apr 2, 2008, at 02:33 ,Marco wrote:

I need to reshape a World Development Indicators dataset. Currently, it is organized as follows.

country var year2000 year2001 year2002
Angola GDP 100 102 104
Angola Export 20 21 20
Algeria GDP 200 202 204
Algeria Export 10 11 10

country and var are string variables.

The dataset has 26500 rows and 43 columns (53 countries, 37 years, 500 variables per country). I could reduce this if the size is a problem.

I would need the dataset to be organized as follows

country year GDP Export
Angola 2000 100 20
Angola 2001 102 21
Angola 2002 104 20
Algeria 2000 200 10
Algeria 2001 202 11
Algeria 2002 204 10

This dataset would have 502 columns (country, year and 500 variables), and 1961 rows (53 countries times 37 years).
*
*   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