
International Evidence on Sticky Consumption Growth--Empirical Archive (Replication Programs)
=============================================================================================

Christopher D. Carroll, Jirka Slacalek and Martin Sommer, February 26, 2008
ccarroll@jhu.edu, jiri.slacalek@ecb.int, msommer@imf.org

This archive replicates empirical results reported in the paper.
All programs are written in Stata 8.0 or Matlab 7.0.

Folders:
--------

* data: 		data file in Stata, Excel and/or plain text formats
	- dataAllCountries		files with total PCE (and other) series for all 13 countries
	- cStar				files with the "true" consumption extracted with the Kalman filter
	- dataG7countries		dataset with disaggregated consumption data for the G7 countries


* matlab:		Matlab programs used to estimate the Kalman filter specification (main file: run_kalman.m)
	The files use the Kalman filter toolbox of Kevin Murphy downloaded from: http://www.cs.ubc.ca/~murphyk/Software/Kalman/kalman.html
	* dataNoutput:	Folder with data and output files
		- data_kalman_ndss.txt		NDS/Total PCE growth data
	* toolbox:	Folder with the Kalman filter toolbox of Kevin Murphy

	- run_kalman.m:				estimates the "true" consumption growth with the Kalman smoother, prints out table 4 and figures 1 and 2

	- Kalman_Likel.m:			Kalman likelihood function	

	- makeStars.m:				prints out stars (significance levels), called by write1stStage

	- solveLambdas.m:			solves for lambda 1 and 2, called by Kalman_Likel	
	- write1stStage.m:			prints out LaTeX code for table 4


* stata:		Stata programs

	Main file:
	- CampManVsStickyEbatchAll.do		replicates all IV results in the paper (tables 1, 2, 3 and 5)
	
	Other do files:
	- CampManVsStickyETableFunction.do	called by CampManVsStickyEbatchAll.do to compute all results and write table (for a given parameter setup)
	- MakeTestStringJ.do			prints stars (used for the TeX output)
	- transformData.do			constructs data series for the total PCE dataset (all 13 countries)
	- transformDataG7.do			constructs data series for the NDS dataset (G-7 countries)
	- writeTableCampManVsStickyEallCgroupsFin.do	creates TeX output for the Table 2 (with empirical results for groups of countries)
	- writeTableCampManVsStickyEoneLine.do	creates TeX output for each line in Tables 1, 3 and 5
	
	- ivreg2*.* 				the appropriate (ie, outdated, compatible with Stata 7.0) version of ivreg2 ado files (all necessary files)


* text			TeX and pdf files with the empirical appendix (intlStickyCtemplate)


The results in the paper were generated as follows: 
---------------------------------------------------
Table 1:	run CampManVsStickyEbatchAll.do for the baseline instrument set (generates table in tAllCountriesFin.tex)			
Table 2:	run CampManVsStickyEbatchAll.do for the baseline instrument set (generates table in tAllCgroups.tex)			
Table 3:	run CampManVsStickyEbatchAll.do for the "alternative" instrument set, uncomment lines 36-37, comment out lines 41-42 for baseline instrument (generates table in tAllCountriesFin.tex)	
Table 4: 	generated using the Matlab program run_kalman.m (generates table in t1stStage.tex in \programs\matlab\dataNoutput)
Table 5:	run CampManVsStickyEbatchAll.do with: global cStarIndex "1"; at line 26 (generates table in tAllCountriesFin.tex)	
	
Figures 1 and 2:	run run_kalman.m 

tAllCountriesFin.tex and tAllCgroups.tex can be found in \programs\text\tables
Figures 1 and 2 can be found in \programs\matlab\dataNoutput


Notes
-----
After unzipping the archive
- do not change the structure of the directories.

- modify appropriately the "basePath" global variable on the top of CampManVsStickyEbatchAll.do (eg, global basePath "D:\research\stickyConsumption\archive";) and 
kalmanPath on the top of run_kalman.m  

- ensure that the new path name does not contain blank spaces.

- The Stata programs require the version of ivreg2.ado file that's attached with the archive.

