World Development Indicators¶
A collection of cross country data on
- gdp and its components
- government finances
- and much more
Getting the Data¶
One typically downloads one variable at a time from here.
The best format is probably xls.
One gets a file with years as columns.
Getting the Data Into Matlab¶
Replace the column headers for the years with something that makes a valid variable name (e.g. x1970).
Run through Stat/Transfer to obtain a Matlab dataset.
Load the file into matlab. Convert the data portion of the matrix into a matrix by [year, country].
Country indicators are World Bank WITS codes (essentially the same as ISO codes).
The code now directly reads the xls file
- prog: programs
- excel: raw
xlsfiles and generated
matfiles (one for each variable)
- outDir: tables and figures
const_wdi2013: set constants
var_load_yc_wdi2013: load one variable by [country, year]
country_list_wdi2013: make a list of all countries in the data (WITS codes)
- Construct GDP per worker (i.e. per employed person) in constant international dollars.
- Save it as a Matlab matrix by [country, year].
- How does it compare with PWT data?
- Plot the fraction of self-employed workers against GDP per capita in constant international dollars. For the year 2000. What do you find?
- Download a variable from the WDI web site and import it into Matlab.