ENDOGENEITY

11
ENDOGENEITY Development Workshop

description

ENDOGENEITY. Development Workshop. Steps to do today. We have two files (trade equation and growth equation) In trade file we only have cty1

Transcript of ENDOGENEITY

Page 1: ENDOGENEITY

ENDOGENEITY

Development

Workshop

Page 2: ENDOGENEITY

Steps to do today

1. We have two files (trade equation and growth equation)

2. In trade file we only have cty1<cty2, and we need „the other half” too

3. We will run a simple gravity model to get fitted value of trade for each COUPLE.

4. Then we need to aggregate it for each reporting country (each year too)

5. Then we can merge the fitted trade data with the growth equation data and try to run the final regression.

6. Quite a few tricks – stay tuned

Page 3: ENDOGENEITY

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

Page 4: ENDOGENEITY

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

Page 5: ENDOGENEITY

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?/

Page 6: ENDOGENEITY

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)

Page 7: ENDOGENEITY

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

Page 8: ENDOGENEITY

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?

Page 9: ENDOGENEITY

Stage 6 – get finally to see if trade matters for income/growth

Syntax in STATA– ivregress y (x1 x2 x3= z1 z2 z3 z4) 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)

Page 10: ENDOGENEITY

Summary

Learned already– egen– loops– duplicates list/drop– encode

Still to work out– difference-in-difference approach– microeconometrics

Page 11: ENDOGENEITY

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,