PWT: Matlab Code¶
Directory structure:¶
baseDir:
outDir: figures and tablesmatDir: generatedmatfilesdataDir: original data filesprogDir: program files
Programs¶
The code is entirely general purpose (not specific to the course).
go_pwt8startup; add dir to pathconst_pwt8set constantsrun_all_pwt8runs everything in sequenceimport_pwt8imports stata file into matlabvar_load_yc_pwt8loads one variable by [Country,year]country_list_pwt8makes list of countries and years
Basic Steps¶
- Download Stata file.
- Make Stata file into a matlab
datasetusing Stat/Transfer import_pwt8: break the Stata file into individual variables and save them as matlab matrices, indexed by [year, country]var_load_yc_pwt8: loads one variable for a given set of years and countries
Exercises¶
Write code that imports the stata file (
import_pwt8)Write
var_load_yc_pwt8Plot the density of real output per worker in 2000 (
rgdp_density_growth821).Plot the price of consumption against real gdp per worker for the year 2000.
What do you find?