************************************************************************************************** *** This do file creates the replication results for *** Do recipient country characteristics affect international spillovers of CO2-efficiency via trade and FDI? */ *** Richard Perkins (LSE) */ *** Eric Neumayer (LSE) */ *** Published in: Climatic Change, 2011 * ************************************************************************************************** ************************************************************************************************** /* Note: You have to change "local DIR" to the directory you copy the original stata files in */ /* and then run the do file. */ ************************************************************************************************** version 11 *********************************************************************************** local DIR = "C:\Research\Other articles\Emissions efficiency\" /*change relative path to the directory where the files are located */ cd "`DIR'" *********************************************************************************** use "Article for Climatic Change (efficiency).dta", clear *** Note: Graphs were drawn using code developed by Thomas Brambor, William Roberts Clark, Matt Golder. 2005. "Understanding Interaction Models: Improving Empirical Analyses" (Political Analysis 14: 63-82) - http://homepages.nyu.edu/~mrg217/interaction.htm tsset countryid year quietly: xi: xtabond lneiapppco2 lneiappppc industrygdpinter fossil_to_totenergyprod ty25i instquality i.year if year>=1980, robust maxldep(6) maxlags(6) pre(llneiapppco2machmanimpslrowst llneiapppco2fdistockslrowst , endog) * table 1 su lneiapppco2 l.lneiapppco2 lneiappppc industrygdpinter fossil_to_totenergyprod ty25i instquality llneiapppco2machmanimpslrowst llneiapppco2fdistockslrowst SLimpco2_ldv SLfdico2_ldv SLimpco2_ty25 SLfdico2_ty25 SLimpco2_instquality SLfdico2_instquality if e(sample) su lneiapppco2 l.lneiapppco2 lneiappppc industrygdpinter fossil_to_totenergyprod ty25i instquality llneiapppco2machmanimpslrowst llneiapppco2fdistockslrowst SLimpco2_ldv SLfdico2_ldv SLimpco2_ty25 SLfdico2_ty25 SLimpco2_instquality SLfdico2_instquality if e(sample), detail * table 2 corr lneiapppco2 l.lneiapppco2 lneiappppc industrygdpinter fossil_to_totenergyprod ty25i instquality llneiapppco2machmanimpslrowst llneiapppco2fdistockslrowst SLimpco2_ldv SLfdico2_ldv SLimpco2_ty25 SLfdico2_ty25 SLimpco2_instquality SLfdico2_instquality if e(sample) * model 1: No interactions xi: xtabond lneiapppco2 lneiappppc industrygdpinter ty25i instquality fossil_to_totenergyprod i.year if year>=1980, robust maxldep(6) maxlags(6) pre(llneiapppco2machmanimpslrowst llneiapppco2fdistockslrowst , endog) estat abond * model 2: Interaction with LDV xi: xtabond lneiapppco2 lneiappppc industrygdpinter ty25i instquality fossil_to_totenergyprod i.year if year>=1980, robust maxldep(6) maxlags(6) pre(llneiapppco2machmanimpslrowst llneiapppco2fdistockslrowst SLimpco2_ldv SLfdico2_ldv, endog) estat abond * figure 1 #delimit ; capture drop MV conb conse a upper lower; generate MV=((_n-1)/1)-.5; replace MV=. if _n>5.5; * **************************************************************** *; * Grab elements of the coefficient and variance-covariance matrix *; * that are required to calculate the marginal effect and standard *; * errors. *; * **************************************************************** *; matrix b=e(b); matrix list b; matrix V=e(V); matrix list V; scalar b1=b[1,3]; scalar b3=b[1,5]; scalar varb1=V[3,3]; scalar varb3=V[5,5]; scalar covb1b3=V[5,3]; scalar list b1 b3 varb1 varb3 covb1b3; * **************************************************************** *; * Calculate the marginal effect of X on Y for all MV values of *; * the modifying variable Z. *; * **************************************************************** *; gen conb=b1+b3*MV if _n<5.5; * **************************************************************** *; * Calculate the standard errors for the marginal effect of X on Y *; * for all MV values of the modifying variable Z. *; * **************************************************************** *; gen conse=sqrt(varb1+varb3*(MV^2)+2*covb1b3*MV) if _n<5.5; * **************************************************************** *; * Generate upper and lower bounds of the confidence interval. *; * Specify the significance of the confidence interval. *; * **************************************************************** *; gen a=1.64*conse; gen upper=conb+a; gen lower=conb-a; * **************************************************************** *; * Graph the marginal effect of X on Y across the desired range of *; * the modifying variable Z. Show the confidence interval. *; * **************************************************************** *; graph twoway line conb MV, clwidth(medium) clcolor(blue) clcolor(black) || line upper MV, clpattern(dash) clwidth(thin) clcolor(black) || line lower MV, clpattern(dash) clwidth(thin) clcolor(black) || , xlabel(-.5 0 .5 1 1.5 2 2.5 3 3.5, labsize(2.5)) ylabel(-.5 -.25 0 .25, labsize(2.5)) yscale(noline) xscale(noline) legend(col(1) order(1 2) label(1 "Marginal effect of FDI-weighted spatial lag") label(2 "90% Confidence interval") label(3 " ")) yline(0, lcolor(black)) xtitle( "ln(C0{subscript:2}-efficiency) in year t-1", size(3) ) xsca(titlegap(2)) ysca(titlegap(2)) scheme(s2mono) graphregion(fcolor(white)); * **************************************************************** *; * Figure can be saved in a variety of formats. *; * **************************************************************** *; graph export c:\figure1.eps, replace; #delimit cr * model 3: Interaction with education xi: xtabond lneiapppco2 lneiappppc industrygdpinter ty25i instquality fossil_to_totenergyprod i.year if year>=1980, robust maxldep(6) maxlags(6) pre(llneiapppco2machmanimpslrowst llneiapppco2fdistockslrowst SLimpco2_ty25 SLfdico2_ty25, endog) estat abond * figure 2 #delimit ; capture drop MV conb conse a upper lower; generate MV=((_n-1)/1); replace MV=. if _n>15; * **************************************************************** *; * Grab elements of the coefficient and variance-covariance matrix *; * that are required to calculate the marginal effect and standard *; * errors. *; * **************************************************************** *; matrix b=e(b); matrix list b; matrix V=e(V); matrix list V; scalar b1=b[1,2]; scalar b3=b[1,4]; scalar varb1=V[2,2]; scalar varb2=V[8,8]; scalar varb3=V[4,4]; scalar covb1b3=V[4,2]; scalar list b1 b3 varb1 varb2 varb3 covb1b3; * **************************************************************** *; * Calculate the marginal effect of X on Y for all MV values of *; * the modifying variable Z. *; * **************************************************************** *; gen conb=b1+b3*MV if _n<15; * **************************************************************** *; * Calculate the standard errors for the marginal effect of X on Y *; * for all MV values of the modifying variable Z. *; * **************************************************************** *; gen conse=sqrt(varb1+varb3*(MV^2)+2*covb1b3*MV) if _n<15; * **************************************************************** *; * Generate upper and lower bounds of the confidence interval. *; * Specify the significance of the confidence interval. *; * **************************************************************** *; gen a=1.64*conse; gen upper=conb+a; gen lower=conb-a; * **************************************************************** *; * Graph the marginal effect of X on Y across the desired range of *; * the modifying variable Z. Show the confidence interval. *; * **************************************************************** *; graph twoway line conb MV, clwidth(medium) clcolor(blue) clcolor(black) || line upper MV, clpattern(dash) clwidth(thin) clcolor(black) || line lower MV, clpattern(dash) clwidth(thin) clcolor(black) || , xlabel(0 2 4 6 8 10 12, labsize(2.5)) ylabel(-.5 -.25 0 .25 .5 .75 1, labsize(2.5)) yscale(noline) xscale(noline) legend(col(1) order(1 2) label(1 "Marginal effect of import-weighted spatial lag") label(2 "90% Confidence interval") label(3 " ")) yline(0, lcolor(black)) xtitle( "Years of schooling populaton aged >=25", size(3) ) xsca(titlegap(2)) ysca(titlegap(2)) scheme(s2mono) graphregion(fcolor(white)); * **************************************************************** *; * Figure can be saved in a variety of formats. *; * **************************************************************** *; graph export c:\figure1.eps, replace; #delimit cr * model 4: Interaction with institutional quality xi: xtabond lneiapppco2 lneiappppc industrygdpinter ty25i instquality fossil_to_totenergyprod i.year if year>=1980, robust maxldep(6) maxlags(6) pre(llneiapppco2machmanimpslrowst llneiapppco2fdistockslrowst SLimpco2_instquality SLfdico2_instquality, endog) estat abond * figure 3 #delimit ; capture drop MV conb conse a upper lower; generate MV=((_n-1)/1); replace MV=. if _n>8; * **************************************************************** *; * Grab elements of the coefficient and variance-covariance matrix *; * that are required to calculate the marginal effect and standard *; * errors. *; * **************************************************************** *; matrix b=e(b); matrix list b; matrix V=e(V); matrix list V; scalar b1=b[1,3]; scalar b3=b[1,5]; scalar varb1=V[3,3]; scalar varb3=V[5,5]; scalar covb1b3=V[5,3]; scalar list b1 b3 varb1 varb3 covb1b3; * **************************************************************** *; * Calculate the marginal effect of X on Y for all MV values of *; * the modifying variable Z. *; * **************************************************************** *; gen conb=b1+b3*MV if _n<8; * **************************************************************** *; * Calculate the standard errors for the marginal effect of X on Y *; * for all MV values of the modifying variable Z. *; * **************************************************************** *; gen conse=sqrt(varb1+varb3*(MV^2)+2*covb1b3*MV) if _n<8; * **************************************************************** *; * Generate upper and lower bounds of the confidence interval. *; * Specify the significance of the confidence interval. *; * **************************************************************** *; gen a=1.64*conse; gen upper=conb+a; gen lower=conb-a; * **************************************************************** *; * Graph the marginal effect of X on Y across the desired range of *; * the modifying variable Z. Show the confidence interval. *; * **************************************************************** *; graph twoway line conb MV, clwidth(medium) clcolor(blue) clcolor(black) || line upper MV, clpattern(dash) clwidth(thin) clcolor(black) || line lower MV, clpattern(dash) clwidth(thin) clcolor(black) || , xlabel(0 1 2 3 4 5 6, labsize(2.5)) ylabel(-.25 0 .25, labsize(2.5)) yscale(noline) xscale(noline) legend(col(1) order(1 2) label(1 "Marginal effect of FDI-weighted spatial lag") label(2 "90% Confidence interval") label(3 " ")) yline(0, lcolor(black)) xtitle( "institutional quality", size(3) ) xsca(titlegap(2)) ysca(titlegap(2)) scheme(s2mono) graphregion(fcolor(white)); * **************************************************************** *; * Figure can be saved in a variety of formats. *; * **************************************************************** *; graph export c:\figure1.eps, replace; #delimit cr