log using diffindiff_quarterly_log, replace text preserve set more off *GENERATE TIME DUMMIES AND INTERACTIONS* gen t11=0 replace t11=1 if t==11 gen ott11=ottawa*t11 gen t12=0 replace t12=1 if t==12 gen ott12=ottawa*t12 *GENERATE COUNTRY DUMMIES* quiet tab country, gen(ctry) *EXPORTS BY INDUSTRY, 1 YEAR LAG* ppml realexports t11 ott11 ctry* if ((t==7|t==11) & bilateral==1 & industry=="Agricultural and Vegetable Products" & country~="Afghanistan"), cluster(country) ppml realexports t12 ott12 ctry* if ((t==8|t==12) & bilateral==1 & industry=="Agricultural and Vegetable Products" & country~="Southern Rhodesia"), cluster(country) ppml realexports t11 ott11 ctry* if ((t==7|t==11) & bilateral==1 & industry=="Animals and Animal Products" & country~="Southern Rhodesia"), cluster(country) ppml realexports t12 ott12 ctry* if ((t==8|t==12) & bilateral==1 & industry=="Animals and Animal Products" & country~="Southern Rhodesia"), cluster(country) ppml realexports t11 ott11 ctry* if ((t==7|t==11) & bilateral==1 & industry=="Chemicals and Allied Products" & country~="Southern Rhodesia"), cluster(country) ppml realexports t12 ott12 ctry* if ((t==8|t==12) & bilateral==1 & industry=="Chemicals and Allied Products" & country~="Southern Rhodesia"), cluster(country) ppml realexports t11 ott11 ctry* if ((t==7|t==11) & bilateral==1 & industry=="Fibres, Textiles and Products" & country~="Southern Rhodesia"), cluster(country) ppml realexports t12 ott12 ctry* if ((t==8|t==12) & bilateral==1 & industry=="Fibres, Textiles and Products" & country~="Southern Rhodesia"), cluster(country) ppml realexports t11 ott11 ctry* if ((t==7|t==11) & bilateral==1 & industry=="Iron and Its Products" & country~="Southern Rhodesia"), cluster(country) ppml realexports t12 ott12 ctry* if ((t==8|t==12) & bilateral==1 & industry=="Iron and Its Products" & country~="Southern Rhodesia"), cluster(country) ppml realexports t11 ott11 ctry* if ((t==7|t==11) & bilateral==1 & industry=="Miscellaneous Commodities" & country~="Southern Rhodesia"), cluster(country) ppml realexports t12 ott12 ctry* if ((t==8|t==12) & bilateral==1 & industry=="Miscellaneous Commodities" & country~="Southern Rhodesia"), cluster(country) ppml realexports t11 ott11 ctry* if ((t==7|t==11) & bilateral==1 & industry=="Non-Ferrous Metal Products" & country~="Southern Rhodesia"), cluster(country) ppml realexports t12 ott12 ctry* if ((t==8|t==12) & bilateral==1 & industry=="Non-Ferrous Metal Products" & country~="Southern Rhodesia"), cluster(country) ppml realexports t11 ott11 ctry* if ((t==7|t==11) & bilateral==1 & industry=="Non-Metallic Mineral Products" & country~="Southern Rhodesia"), cluster(country) ppml realexports t12 ott12 ctry* if ((t==8|t==12) & bilateral==1 & industry=="Non-Metallic Mineral Products" & country~="Southern Rhodesia"), cluster(country) ppml realexports t11 ott11 ctry* if ((t==7|t==11) & bilateral==1 & industry=="Paper and Wood" & country~="Southern Rhodesia"), cluster(country) ppml realexports t12 ott12 ctry* if ((t==8|t==12) & bilateral==1 & industry=="Paper and Wood" & country~="Southern Rhodesia"), cluster(country) *TOTAL EXPORTS, 1 YEAR LAG* ppml realexports t11 ott11 ctry* if ((t==7|t==11) & bilateral==1 & industry=="Total Merchandise Trade" & country~="Southern Rhodesia"), cluster(country) ppml realexports t12 ott12 ctry* if ((t==8|t==12) & bilateral==1 & industry=="Total Merchandise Trade" & country~="Southern Rhodesia"), cluster(country) *IMPORTS BY INDUSTRY, 1 YEAR LAG* ppml realimports t11 ott11 ctry* if ((t==7|t==11) & bilateral==1 & industry=="Agricultural and Vegetable Products" & country~="Southern Rhodesia"), cluster(country) ppml realimports t12 ott12 ctry* if ((t==8|t==12) & bilateral==1 & industry=="Agricultural and Vegetable Products" & country~="Southern Rhodesia"), cluster(country) ppml realimports t11 ott11 ctry* if ((t==7|t==11) & bilateral==1 & industry=="Animals and Animal Products" & country~="Southern Rhodesia"), cluster(country) ppml realimports t12 ott12 ctry* if ((t==8|t==12) & bilateral==1 & industry=="Animals and Animal Products" & country~="Southern Rhodesia"), cluster(country) ppml realimports t11 ott11 ctry* if ((t==7|t==11) & bilateral==1 & industry=="Chemicals and Allied Products" & country~="Southern Rhodesia"), cluster(country) ppml realimports t12 ott12 ctry* if ((t==8|t==12) & bilateral==1 & industry=="Chemicals and Allied Products" & country~="Southern Rhodesia"), cluster(country) ppml realimports t11 ott11 ctry* if ((t==7|t==11) & bilateral==1 & industry=="Fibres, Textiles and Products" & country~="Southern Rhodesia"), cluster(country) ppml realimports t12 ott12 ctry* if ((t==8|t==12) & bilateral==1 & industry=="Fibres, Textiles and Products" & country~="Southern Rhodesia"), cluster(country) ppml realimports t11 ott11 ctry* if ((t==7|t==11) & bilateral==1 & industry=="Iron and Its Products" & country~="Southern Rhodesia"), cluster(country) ppml realimports t12 ott12 ctry* if ((t==8|t==12) & bilateral==1 & industry=="Iron and Its Products" & country~="Southern Rhodesia"), cluster(country) ppml realimports t11 ott11 ctry* if ((t==7|t==11) & bilateral==1 & industry=="Miscellaneous Commodities" & country~="Southern Rhodesia"), cluster(country) ppml realimports t12 ott12 ctry* if ((t==8|t==12) & bilateral==1 & industry=="Miscellaneous Commodities" & country~="Southern Rhodesia"), cluster(country) ppml realimports t11 ott11 ctry* if ((t==7|t==11) & bilateral==1 & industry=="Non-Ferrous Metal Products" & country~="Southern Rhodesia"), cluster(country) ppml realimports t12 ott12 ctry* if ((t==8|t==12) & bilateral==1 & industry=="Non-Ferrous Metal Products" & country~="Southern Rhodesia"), cluster(country) ppml realimports t11 ott11 ctry* if ((t==7|t==11) & bilateral==1 & industry=="Non-Metallic Mineral Products" & country~="Southern Rhodesia"), cluster(country) ppml realimports t12 ott12 ctry* if ((t==8|t==12) & bilateral==1 & industry=="Non-Metallic Mineral Products" & country~="Southern Rhodesia"), cluster(country) ppml realimports t11 ott11 ctry* if ((t==7|t==11) & bilateral==1 & industry=="Paper and Wood" & country~="Southern Rhodesia"), cluster(country) ppml realimports t12 ott12 ctry* if ((t==8|t==12) & bilateral==1 & industry=="Paper and Wood" & country~="Southern Rhodesia"), cluster(country) *TOTAL IMPORTS, 1 YEAR LAG* ppml realimports t11 ott11 ctry* if ((t==7|t==11) & bilateral==1 & industry=="Total Merchandise Trade" & country~="Southern Rhodesia"), cluster(country) ppml realimports t12 ott12 ctry* if ((t==8|t==12) & bilateral==1 & industry=="Total Merchandise Trade" & country~="Southern Rhodesia"), cluster(country) *ROBUSTNESS* *WITH DIFFERENT TIME HORIZONS gen t8=0 replace t8=1 if t==8 gen ott8=ottawa*t8 gen t9=0 replace t9=1 if t==9 gen ott9=ottawa*t9 gen t10=0 replace t10=1 if t==10 gen ott10=ottawa*t10 gen t13=0 replace t13=1 if t==13 gen ott13=ottawa*t13 gen t14=0 replace t14=1 if t==14 gen ott14=ottawa*t14 gen t15=0 replace t15=1 if t==15 gen ott15=ottawa*t15 gen t16=0 replace t16=1 if t==16 gen ott16=ottawa*t16 gen t17=0 replace t17=1 if t==17 gen ott17=ottawa*t17 gen t18=0 replace t18=1 if t==18 gen ott18=ottawa*t18 gen t19=0 replace t19=1 if t==19 gen ott19=ottawa*t19 gen t20=0 replace t20=1 if t==20 gen ott20=ottawa*t20 ppml realexports t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 ott8 ott9 ott10 ott11 ott12 ott13 ott14 ott15 ott16 ott17 ott18 ott19 ctry* if ((t==7|t==8|t==9|t==10|t==11|t==12|t==13|t==14|t==15|t==16|t==17|t==18|t==19) & bilateral==1 & industry=="Total Merchandise Trade" & country~="Southern Rhodesia"), cluster(country) ppml realexports t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20 ott9 ott10 ott11 ott12 ott13 ott14 ott15 ott16 ott17 ott18 ott19 ott20 ctry* if ((t==8|t==9|t==10|t==11|t==12|t==13|t==14|t==15|t==16|t==17|t==18|t==19|t==20) & bilateral==1 & industry=="Total Merchandise Trade" & country~="Southern Rhodesia"), cluster(country) ppml realimports t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 ott8 ott9 ott10 ott11 ott12 ott13 ott14 ott15 ott16 ott17 ott18 ott19 ctry* if ((t==7|t==8|t==9|t==10|t==11|t==12|t==13|t==14|t==15|t==16|t==17|t==18|t==19) & bilateral==1 & industry=="Total Merchandise Trade" & country~="Southern Rhodesia"), cluster(country) ppml realimports t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20 ott9 ott10 ott11 ott12 ott13 ott14 ott15 ott16 ott17 ott18 ott19 ott20 ctry* if ((t==8|t==9|t==10|t==11|t==12|t==13|t==14|t==15|t==16|t==17|t==18|t==19|t==20) & bilateral==1 & industry=="Total Merchandise Trade" & country~="Southern Rhodesia"), cluster(country) *WITH REDEFINITION OF EMPIRE gen emp11=empire*t11 gen emp12=empire*t12 ppml realexports t11 emp11 ctry* if ((t==7|t==11) & bilateral==1 & industry=="Total Merchandise Trade" & country~="Southern Rhodesia"), cluster(country) ppml realexports t12 emp12 ctry* if ((t==8|t==12) & bilateral==1 & industry=="Total Merchandise Trade" & country~="Southern Rhodesia"), cluster(country) ppml realimports t11 emp11 ctry* if ((t==7|t==11) & bilateral==1 & industry=="Total Merchandise Trade" & country~="Southern Rhodesia"), cluster(country) ppml realimports t12 emp12 ctry* if ((t==8|t==12) & bilateral==1 & industry=="Total Merchandise Trade" & country~="Southern Rhodesia"), cluster(country) *WITH DISAGGREGATE PRICE INDICES* gen realexports2=exportsfromcanada*100/exportp gen realimports2=importsintocanada*100/importp ppml realexports2 t11 ott11 ctry* if ((t==7|t==11) & bilateral==1 & industry=="Agricultural and Vegetable Products" & country~="Southern Rhodesia"), cluster(country) ppml realexports2 t12 ott12 ctry* if ((t==8|t==12) & bilateral==1 & industry=="Agricultural and Vegetable Products" & country~="Southern Rhodesia"), cluster(country) ppml realexports2 t11 ott11 ctry* if ((t==7|t==11) & bilateral==1 & industry=="Animals and Animal Products" & country~="Southern Rhodesia"), cluster(country) ppml realexports2 t12 ott12 ctry* if ((t==8|t==12) & bilateral==1 & industry=="Animals and Animal Products" & country~="Southern Rhodesia"), cluster(country) ppml realexports2 t11 ott11 ctry* if ((t==7|t==11) & bilateral==1 & industry=="Chemicals and Allied Products" & country~="Southern Rhodesia"), cluster(country) ppml realexports2 t12 ott12 ctry* if ((t==8|t==12) & bilateral==1 & industry=="Chemicals and Allied Products" & country~="Southern Rhodesia"), cluster(country) ppml realexports2 t11 ott11 ctry* if ((t==7|t==11) & bilateral==1 & industry=="Fibres, Textiles and Products" & country~="Southern Rhodesia"), cluster(country) ppml realexports2 t12 ott12 ctry* if ((t==8|t==12) & bilateral==1 & industry=="Fibres, Textiles and Products" & country~="Southern Rhodesia"), cluster(country) ppml realexports2 t11 ott11 ctry* if ((t==7|t==11) & bilateral==1 & industry=="Iron and Its Products" & country~="Southern Rhodesia"), cluster(country) ppml realexports2 t12 ott12 ctry* if ((t==8|t==12) & bilateral==1 & industry=="Iron and Its Products" & country~="Southern Rhodesia"), cluster(country) ppml realexports2 t11 ott11 ctry* if ((t==7|t==11) & bilateral==1 & industry=="Miscellaneous Commodities" & country~="Southern Rhodesia"), cluster(country) ppml realexports2 t12 ott12 ctry* if ((t==8|t==12) & bilateral==1 & industry=="Miscellaneous Commodities" & country~="Southern Rhodesia"), cluster(country) ppml realexports2 t11 ott11 ctry* if ((t==7|t==11) & bilateral==1 & industry=="Non-Ferrous Metal Products" & country~="Southern Rhodesia"), cluster(country) ppml realexports2 t12 ott12 ctry* if ((t==8|t==12) & bilateral==1 & industry=="Non-Ferrous Metal Products" & country~="Southern Rhodesia"), cluster(country) ppml realexports2 t11 ott11 ctry* if ((t==7|t==11) & bilateral==1 & industry=="Non-Metallic Mineral Products" & country~="Southern Rhodesia"), cluster(country) ppml realexports2 t12 ott12 ctry* if ((t==8|t==12) & bilateral==1 & industry=="Non-Metallic Mineral Products" & country~="Southern Rhodesia"), cluster(country) ppml realexports2 t11 ott11 ctry* if ((t==7|t==11) & bilateral==1 & industry=="Paper and Wood" & country~="Southern Rhodesia"), cluster(country) ppml realexports2 t12 ott12 ctry* if ((t==8|t==12) & bilateral==1 & industry=="Paper and Wood" & country~="Southern Rhodesia"), cluster(country) ppml realexports2 t11 ott11 ctry* if ((t==7|t==11) & bilateral==1 & industry=="Total Merchandise Trade" & country~="Southern Rhodesia"), cluster(country) ppml realexports2 t12 ott12 ctry* if ((t==8|t==12) & bilateral==1 & industry=="Total Merchandise Trade" & country~="Southern Rhodesia"), cluster(country) ppml realimports2 t11 ott11 ctry* if ((t==7|t==11) & bilateral==1 & industry=="Agricultural and Vegetable Products" & country~="Southern Rhodesia"), cluster(country) ppml realimports2 t12 ott12 ctry* if ((t==8|t==12) & bilateral==1 & industry=="Agricultural and Vegetable Products" & country~="Southern Rhodesia"), cluster(country) ppml realimports2 t11 ott11 ctry* if ((t==7|t==11) & bilateral==1 & industry=="Animals and Animal Products" & country~="Southern Rhodesia"), cluster(country) ppml realimports2 t12 ott12 ctry* if ((t==8|t==12) & bilateral==1 & industry=="Animals and Animal Products" & country~="Southern Rhodesia"), cluster(country) ppml realimports2 t11 ott11 ctry* if ((t==7|t==11) & bilateral==1 & industry=="Chemicals and Allied Products" & country~="Southern Rhodesia"), cluster(country) ppml realimports2 t12 ott12 ctry* if ((t==8|t==12) & bilateral==1 & industry=="Chemicals and Allied Products" & country~="Southern Rhodesia"), cluster(country) ppml realimports2 t11 ott11 ctry* if ((t==7|t==11) & bilateral==1 & industry=="Fibres, Textiles and Products" & country~="Southern Rhodesia"), cluster(country) ppml realimports2 t12 ott12 ctry* if ((t==8|t==12) & bilateral==1 & industry=="Fibres, Textiles and Products" & country~="Southern Rhodesia"), cluster(country) ppml realimports2 t11 ott11 ctry* if ((t==7|t==11) & bilateral==1 & industry=="Iron and Its Products" & country~="Southern Rhodesia"), cluster(country) ppml realimports2 t12 ott12 ctry* if ((t==8|t==12) & bilateral==1 & industry=="Iron and Its Products" & country~="Southern Rhodesia"), cluster(country) ppml realimports2 t11 ott11 ctry* if ((t==7|t==11) & bilateral==1 & industry=="Miscellaneous Commodities" & country~="Southern Rhodesia"), cluster(country) ppml realimports2 t12 ott12 ctry* if ((t==8|t==12) & bilateral==1 & industry=="Miscellaneous Commodities" & country~="Southern Rhodesia"), cluster(country) ppml realimports2 t11 ott11 ctry* if ((t==7|t==11) & bilateral==1 & industry=="Non-Ferrous Metal Products" & country~="Southern Rhodesia"), cluster(country) ppml realimports2 t12 ott12 ctry* if ((t==8|t==12) & bilateral==1 & industry=="Non-Ferrous Metal Products" & country~="Southern Rhodesia"), cluster(country) ppml realimports2 t11 ott11 ctry* if ((t==7|t==11) & bilateral==1 & industry=="Non-Metallic Mineral Products" & country~="Southern Rhodesia"), cluster(country) ppml realimports2 t12 ott12 ctry* if ((t==8|t==12) & bilateral==1 & industry=="Non-Metallic Mineral Products" & country~="Southern Rhodesia"), cluster(country) ppml realimports2 t11 ott11 ctry* if ((t==7|t==11) & bilateral==1 & industry=="Paper and Wood" & country~="Southern Rhodesia"), cluster(country) ppml realimports2 t12 ott12 ctry* if ((t==8|t==12) & bilateral==1 & industry=="Paper and Wood" & country~="Southern Rhodesia"), cluster(country) ppml realimports2 t11 ott11 ctry* if ((t==7|t==11) & bilateral==1 & industry=="Total Merchandise Trade" & country~="Southern Rhodesia"), cluster(country) ppml realimports2 t12 ott12 ctry* if ((t==8|t==12) & bilateral==1 & industry=="Total Merchandise Trade" & country~="Southern Rhodesia"), cluster(country) restore