World Development Indicators

A collection of cross country data on

  • gdp and its components
  • employment
  • demographics
  • education
  • 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

Matlab Code


  • prog: programs
  • excel: raw xls files and generated mat files (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)


  1. Construct GDP per worker (i.e. per employed person) in constant international dollars.
    1. Save it as a Matlab matrix by [country, year].
    2. How does it compare with PWT data?
  2. Plot the fraction of self-employed workers against GDP per capita in constant international dollars. For the year 2000. What do you find?
  3. Download a variable from the WDI web site and import it into Matlab.