*Author: Yuan Tian
*Date: 021114
/*===========================================================================================*/
/* Stata Do File for analysis of IMF initial diagnosis*/
/* Evaluation on Capital Controls Management Measures */
/*===========================================================================================*/
*This program is based on the data set collected following the IMF coding manual.
*The program aims at quantitative analysis on IMF institutional view on capital flows and
*tests whether the level of supports changes due to the 2007 global financial crises.
*Change the directory
cd "C:\Users\tiany_000\Desktop\goal\analysis.dta"
clear
// =============== Raw Data Cleaning================
*Clean the data
*After comparing the coding with IEO report Table 3.1 consistantly, the analysis focuses
*on the time period 2001-2013 due to several reasons listed in the paper.
drop if year<2001
*generate the crises dummy which indicates 1 when crises happen after 2007
gen crises=0
replace crises=1 if year>2007
*produce a electronic codebook from the data file and summarize statistics
codebook
// =============== Descriptive Stats================
*tables calculate the frequencies in variables of interest
tab1 availability relationshipwithimf imfinitialdiagnosis mentionofcfms levelofsupport
*make crosstabs on relationship between imfinitialdiagnosis, mentionofcfms and levelofsupport
tabulate mentionofcfms imfinitialdiagnosis, column nofreq
tabulate levelofsupport mentionofcfms, column
tabulate levelofsupport year, column
*list of statistics of interest by year
sort year
by year: summarize imfinitialdiagnosis mentionofcfms levelofsupport
*summary by year
tabulate year, summarize (imfinitialdiagnosis)
tabulate year, summarize (levelofsupport)
// =============== Graphs================
histogram levelofsupport, percent discrete
*Comparison between before and after cirses
graph box levelofsupport, by(crises)
*produce a boxplot to examine the distribution of levelofsupports.
graph box mentionofcfms, over(year) noout
graph pie, over(levelofsupport) plabel(_all name) title("IMF level of support on capital flows")
*Interpretation: The line (the median) would be in the middle of the box (the 25th and 75th percentiles, Q1 and Q3) and
*the ends of the whiskers (the upper and lower adjacent values, which are the most extreme values which within Q3+1.5(Q3-Q1) and Q1-1.5*(Q3-Q1), respectively)
*would be equidistant from the box. The boxplot here shows positive skew. The median is pulled to the low end of the box.
graph box levelofsupport, by(region) over(crises)
twoway (scatter levelofsupport year) (lfitci levelofsupport year), by(crises)
// =============== Regression Analysis================
tsset year countrycode
*test colinearity in simple regression
reg mentionofcfms crises
reg imfinitialdiagnosis crises
reg levelofsupport crises
*including the capital freeze index
reg mentionofcfms crises compositeindexweighted
reg imfinitialdiagnosis crises compositeindexweighted
reg levelofsupport crises compositeindexweighted
twoway (scatter levelofsupport year) (lfitci levelofsupport year), by(crises) by(region)
* use imf initial diagnosis as an instrument(pick the only significant one)
xtreg financialopenness imfinitialdiagnosis, fe robust
* use level of support as instrument
xtreg domesticcredit levelofsupport, fe robust
xtreg financialopenness mentionofcfms, fe robust
xtreg currentbalance mentionofcfms, fe robust
xtreg externaldebt mentionofcfms, fe robust
xtreg domesticcredit mentionofcfms, fe robust
*try quantile
qreg financialopenness gdpcurrentus levelofsupport
sqreg financialopenness gdpcurrentus levelofsupport, quantile(.1 .25 .5 .75 .9)
*graph quantile regression
grqreg financialopenness gdpcurrentus levelofsupport
dpplot financialopenness
diagsm financialopenness gdpcurrent