140 likes | 292 Views
ENDOGENEITY. Development Workshop. Steps to do today. We have two files (trade equation and growth equation) In trade file we only have cty1<cty2, and we need „the other half” too We will run a simple gravity model to get fitted value of trade for each COUPLE.
E N D
ENDOGENEITY Development Workshop
Steps to do today • We have two files (trade equation and growth equation) • In trade file we only have cty1<cty2, and we need „the other half” too • We will run a simple gravity model to get fitted value of trade for each COUPLE. • Then we need to aggregate it for each reporting country (each year too) • Then we can merge the fitted trade data with the growth equation data and try to run the final regression. • Quite a few tricks – stay tuned
Step by step • Use the trade data sort cty1 cty2 year • Using auxiliary files to get only those variables/periods that you need („hygene”) outfile cty1 cty2 ccode1 ccode2 year cu lvalue ldist rgdppc1 rgdppc2 pop1 pop2 comlang border regional areap ll island using pomocniczy, replace dictionary
Stage 1 – prepare the files to run gravity models infile using auxiliary_file sort cty1 cty2 year save pomocniczy1, replace rename ccode1 crap rename ccode2 ccode1 … save auxiliary_file2,replace
Stage 2 – combine the „mirror” files • Merge aux1 and aux2 • use auxiliary1 • append using auxiliary2 • sort cty1 cty2 • What will we want as fitted variables? • ln(trade) or trade/GDP % /What did Frankel & Rose do?/
Stage 3 – gen some variables and run the regressions • Gen some needed variables • Run the regression to get the fitted values… • areg lhs ldist lpop2 comlang border areap ll if (cty1<cty2), robust a(year) • predict lhsf • label var lhsf "Fitted LHS” • Why areg and not xtreg? • This is log of trade – we need trade…. • gen elhsf=exp(lhsf)
Stage 4 – get trade for each reporting country • Somehow sum it over reporting country • sort cty1 cty2 • egen elhsfs=sum(elhsf), by(cty1) • Merge it with growth data • Use growth data and merge • merge ccode year using auxiliary_file3 • Let’s see how the merging went… • tab _merge • Houston, we have a problem
Stage 5 – prepare „panel” data • Somehow get rid of the duplicates (preferably not manually) • duplicates list • duplicates drop, force • Somehow get from annual data to five-year averages • we can’t just drop every four out of five observations • we need to do it for many variables, so loops would be usefull • What did F&R do in their paper?
Stage 6 – get finally to see if trade matters for income/growth • Syntax in STATA • ivregressy (x1x2x3= z1z2z3z4) x4 x5 x6 We run a regression in which • y is explained • x1, x2, x3 are endogenous (instrumented for) • z1, z2, z3 are exogenous (instruments) • x3, x4 x5 are exogenous too (do not need to be instrumented)
Summary • Learned already • egen • loops • duplicates list/drop • encode • Still to work out • difference-in-difference approach • microeconometrics
Papers • Ann Harrison, Opennes and growth: A time-series, cross-country analysis of developing countries, Journal of Development Economics, 1996 • Jeffrey Frankel i David Romer, Does Trade Cause Growth?, AER 1999 • Jeffrey Frankel i Andrew K. Rose, One Money, One Currency,