23
GRAVITY EQUATION FOR INTERNATIONAL TRADE MODELING September 2014 CLASS SCRIPT: BASIC DEFINITIONS AND STATA HANDS ON EXERCISE - The content of this document, specially for the exercise section, is based on the document prepared by UNCTAD-WTO entitled “A Practical Guide to Trade Policy Analysis. (Chapter 3. Analyzing bilateral trade using the gravity equation). To access to the on-line version of full volume visit the WEB page: http://vi.unctad.org/tpa/index.html 1.- OTHER DOCS AND SOURCES OF INTEREST OTHER RELEVANT WORKS for those who want to go further in this specific topic: - Head, K. (2003), “Gravity for beginners”, mimeo, University of British Columbia. https://www3.nd.edu/~agervais/documents/Gravity.pdf - Another “accessible” example of a STATA Gravity – Models exercise: http://www.agrodep.org/sites/default/files/ Technical_notes/AGRODEP-TN-05_2.pdf - More detail about some of the main issues on the econometrical specification/estimation: The Gravity Model in International Trade AGRODEP Technical Note TN -04. Luca Salvatici. http://www.agrodep.org/sites/default/files/Technical_notes/AGRODEP-TN-04- 2_1.pdf - A really complete and in depth work about gravity equations and their use for empirical exercises (almost 70 pages!). 1

Web viewA difference between origins GDP and destination GDPs is expected, a lower estimation for importer GDPs would suggest evidence of home market effects

Embed Size (px)

Citation preview

Page 1: Web viewA difference between origins GDP and destination GDPs is expected, a lower estimation for importer GDPs would suggest evidence of home market effects

GRAVITY EQUATION FOR INTERNATIONAL TRADE MODELING

September 2014

CLASS SCRIPT: BASIC DEFINITIONS AND STATA HANDS ON EXERCISE

- The content of this document, specially for the exercise section, is based on the document prepared by UNCTAD-WTO entitled “A Practical Guide to Trade Policy Analysis. (Chapter 3. Analyzing bilateral trade using the gravity equation).

To access to the on-line version of full volume visit the WEB page: http://vi.unctad.org/tpa/index.html

1.- OTHER DOCS AND SOURCES OF INTEREST

OTHER RELEVANT WORKS for those who want to go further in this specific topic:

- Head, K. (2003), “Gravity for beginners”, mimeo, University of British Columbia.https://www3.nd.edu/~agervais/documents/Gravity.pdf

- Another “accessible” example of a STATA Gravity – Models exercise:

http://www.agrodep.org/sites/default/files/Technical_notes/AGRODEP-TN-05_2.pdf

- More detail about some of the main issues on the econometrical specification/estimation:

The Gravity Model in International Trade AGRODEP Technical Note TN -04. Luca Salvatici.

http://www.agrodep.org/sites/default/files/Technical_notes/AGRODEP-TN-04-2_1.pdf

- A really complete and in depth work about gravity equations and their use for empirical exercises (almost 70 pages!).

Head, K., & Mayer, T. (2013). Gravity equations: Workhorse, toolkit, and cookbook. Handbook of international economics, 4.

http://strategy.sauder.ubc.ca/head/papers/headmayer_revised.pdf

- Seminal work on the econometric implications of Jensen’s inequality in the context of gravity equation:

Silva, J. S., & Tenreyro, S. (2006). The log of gravity. The Review of Economics and statistics, 88(4), 641-658. http://personal.lse.ac.uk/tenreyro/jensen08k.pdf

1

Page 2: Web viewA difference between origins GDP and destination GDPs is expected, a lower estimation for importer GDPs would suggest evidence of home market effects

- Seminal paper about the role of Multilateral Trade Resistance term in gravity equation: Anderson, J. E. and van Wincoop, E. (2003), “Gravity with gravitas: a solution to the border puzzle”, American Economic Review 93: 170–92.

http://www.econ.ku.dk/Nguyen/teaching/Anderson%20van%20Wincoop%202003%20Gravitas.pdf

2.- SOME BASIC THEORY AND DEFINITIONS

Foundations of a Gravity Model for international trade:

- Following Newton expression for masses it states that, broadly constructed, trade (attraction) between two countries is proportional to their size (size of the economy) and inversely proportional to their distance.

- Surprisingly enough, gravity equations did (and do) a pretty successful job at explaining trade with just the size of the economies and their distances, even before that someone did find a theoretical basis for it, suggesting a stable relationship between size of the economies, proximity and trade among them.

- Widely used to infer trade flow potentials, or to estimate the effects on trade of institutions such as customs unions, monetary agreement, exchange rate mechanism, ethnic ties, linguistic identity, international borders

- The basic expression is currently formulated as: the trade flow from country i to country j (Xij) is proportional to the product of the two countries’ GDPs (Yi , Yj) and inversely proportional to their distance, Dij, broadly construed to include all factors that might create trade resistance.

X ij=α0Y iα 1Y j

α2Dijα 3 εij

o α0: Variable/Coefficient not depending on “i” or “j” o Xij: Exports from “i” to “j” (or imports of “j” from “i” )o Yi: Exporter factors (GDPi, for example,…)o Yj: Importer factors (GDPj, for example,..)o Dij:distance/trade barriers of exporter “i” to enter / reach market “j” o εij: random term (not analogue to Physics determinism)

- Apart from being intuitive and apparently empirically true, some studies have been able to provide theoretical foundations for the gravity model/equation1. This theoretical foundations are critical to understand the right specification of the empirical model and the proper way of doing correct econometrical inferences, for examples:

1 See an intuitive sketch in the text Head, K. (2003), “Gravity for beginners” of British Columbia University. https://www3.nd.edu/~agervais/documents/Gravity.pdf

2

Page 3: Web viewA difference between origins GDP and destination GDPs is expected, a lower estimation for importer GDPs would suggest evidence of home market effects

o According to the theoretical background, elasticities of GDP’s and distance should be around 1

o According to the theory, the gravity equation SHOULD have multiplicative shape

o According to the theory derivation, the gravitation equation MUST also include a Multilateral Resistance Term OR “remoteness” term (as seen later on)

o ……and many more interesting facts that frame / condition empirical exercises

- One of the common questions of newcomers is: Is the physical distance really an explanatory variable for trade? Yes. Some studies illustrate that distance matter so much because it measures somehow a lot of relevant trade – resistance issues: transaction costs, transport costs, perishability/losses of goods during transport, synchronization costs, communication costs, cultural distance….

- Some almost evident - additional - main features of the equation:

o Multiplicative form: very important empirical/econometrical implicationso Multilevel:

Unit of observations: “i” and “j” might represent countries, regions, provinces, or even firms and …

“x” might represent TOTAL trade, share of trade, sectoral trade, product trade,…

…or even a NON TRADE variable: migration, commuting, passengers, trips, fleets…

…..BUT…be carefull when dealing with disaggregated data because some critical issues appear when dealing with empirics

o A time subindex “t” might be added to every term

The importance of Multilateral Trade Resistance term (MTR). (Anderson and van Wincoop’s (2003))

- The authors (among others) showed that “The gravity equation tells us that bilateral trade, after controlling for size, depends on the bilateral trade barriers between “i” and “j” BUT RELATIVE to the product of their Multilateral Resistance Indices”: bilateral barrier between them relative to average trade barriers that both regions face with all their trading partners. Two neighbor countries will trade more if they are isolated from the rest of the world.

- Good example of the idea found at Head, k (2003): “The importance of remoteness in actual trade patterns can be illustrated by comparing trade between Australia and New Zealand with trade between Austria and Portugal. The distance between each pair’s major city is approximately the same: Lisbon–Vienna and Auckland–Canberra both happen to be 1430 miles apart. Furthermore the product of their GDP’s are similar (Australia–New Zealand is 20% smaller). Hence, omitting remoteness, the gravity equation would predict that Austria–Portugal trade would be slightly larger. In fact, however, in 1993 Australia–New Zealand trade was nine times greater than Austria–Portugal Trade”.

3

Page 4: Web viewA difference between origins GDP and destination GDPs is expected, a lower estimation for importer GDPs would suggest evidence of home market effects

- It is easy to see why higher multilateral resistance of the importer raises its trade with “i”.

o For a given bilateral barrier between “i” and “j”, higher barriers between “j” and its other trading partners will reduce the relative price of goods from “i” and raise imports from “i”.

o Higher multilateral resistance of the exporter also raises trade. Higher trade barriers faced by an exporter will lower the demand for its goods and therefore its supply price “pi”. For a given bilateral barrier between “i” and “j”, this raises the level of trade between them.

- Empirical implication: All this means that in the gravity equation, we have to include MTR (or the inverse, that said, easiness to trade) for EITHER “i” and “j”. Following Anderson and van Wincoop’s derivation, the gravity equation turns out to be:

X ij=Y iY j

Y ( tijΠ i Ρ j )

1−σ

where

o Xij: Exports from “i” to “j” (or imports of “j” from “i” )o Yi/Yj/Y: GPD measures for “i”, “j” and the wordo tij: One plus the tariff equivalent of overall trade costs of imports of “j” from

“i”o σ: elasticity of substitution o Πj: Ease of access of exporter “i”o Ρj: Ease of access of importer “j”

- What if we omit MRT?. The empirical problem is that multilateral resistance terms are functions of all bilateral trade barriers, which in turn are a function of “distance” and “barriers dummies”. Omitting MTR induce potentially severe bias in the coefficients of the distance and border variables.

3.- INTRODUCTION TO EMPIRICAL ESTIMATION OF A GRAVITY MODEL

- Basics:

o Expression: following Anderson and van Wincoop’s formula we come to the linearized expression:

lnX ij=a0+a1lnY i+a2lnY j+a3lnt ij+a4lnΠ i+a5 ln Ρ j+εij

Where:

Parameters as elasticities

4

Page 5: Web viewA difference between origins GDP and destination GDPs is expected, a lower estimation for importer GDPs would suggest evidence of home market effects

Πj ease of access of exporter “i” and Ρj ease of access of importer “j” (MTR like terms)

a3=1-σ “εij” is an error term

Attention:

“Xij” represents only the flow from “i” to “j”; there might be another observation for trade from “j” to “i”. We shouldn’t aggregate both averaging the reciprocal trade flows

FOB or CIF values? One might understand that it depends on if we are measuring Xit as exports from “i” to “j” or imports of “j” from “i” but NO. Basically, FOB are the best option (if available)2.

GDP’s, if added, and trade flows (X) are measured in nominal terms (non real terms)3

o Observables:

GDP’s Vector tij containing both BARRIERS and INCENTIVES to trade

between “i” and “j”. Normally, it includes “ij” variables:

“Natural” barriers / trade costs “ij”: (dij): Bilateral distance “ij” (as proxy for transport costs):

different means of distance calculation between countries4

Others (dummies): (ISij) one of the two being islands, (LLij) one of the two being landlocked countries,

Incentives “ij”: (CBij) Common border or adjacency Existence of Bilateral, Regional or Multilateral Trade

Agreement (TAij)o Usually with a dummy, although some caveats

should be made5

Lower information costs:o Common language (CLij)

2 Using CIF data may lead to simultaneous equation biases, as the dependent variable includes costs that are correlated with the right hand side variables for distance and other trade costs.

3 “Gravity is an expenditure function allocating nominal GDP into nominal imports; therefore inappropriate deflation probably creates biases via spurious correlations”. UNCTAD-WTO A Practical Guide to Trade Policy Analysis

4 Both in terms of distance measurement choice (Euclidean, great-circle, orthodromic…) and in terms of among “where” to measure (economic “poles”, capitals, main ports,…)5 A dummie is not able to capture those trade agreements with asymmetrical benefits/conditions for its members, for different products or simply with a progressive effect. A single dummy suppose that the “treatment” effect is the same for all the countries participating in this agreement.

5

Page 6: Web viewA difference between origins GDP and destination GDPs is expected, a lower estimation for importer GDPs would suggest evidence of home market effects

o Cultural / Historical ties (had been colonies of each other or a common colonizer) (COLij)

This vector tij usually takes the theoretical based form of (for the previous variables):

t ij=d ijδ1 ·exp (δ2 ISij+δ 3¿ ij+δ4CBij+δ5TAij+δ6CLij+δ7COLij)

- How to deal with non observable nature of MTR:

1.- To use a nonlinear iterative method to estimate MTR effects on prices of MTR terms (Anderson and van Wincoop’s)

2.- To use a linear estimator adding country, or country x time, fixed effects:

o With a cross – section dataset:

Country dummies for countries “i” and “j”: (Ii) and (Ij).

ATTENTION if we allow country dummies in a cross-section approach, we cannot estimate parameters for other country specific variables so this approach is only valid when the interest is on bilateral / country pair coefficients (such as the effect of a common border)

lnX ij=a0+a1 I i+a2 I j+a3 ln (t ¿¿ ij)+εij¿

o With a panel dataset:

Country dummies for countries “i” and “j” INVARIANT on “t” (assuming MTR constant over time).

That allows the estimation of country specific factors if they vary over time = right approach if our interest rely on those variables.

lnX ijt=a0+a1ln (GDP¿¿¿)+a2 ln (GDP¿¿ jt )+a3 Ii+a4 I j+a5 ln (t¿¿ ij)+(a6 I t )+εij¿¿¿

Is the MTR time invariant assumption plausible?: only within short periods of time

Country dummies for countries “i” and “j” and period “t” (allowing MTR change over time): (Iit) and (Ijt).

ATTENTION, if we allow time varying country dummies, we cannot estimate parameters for other time varying country specific variables (such as GDP, for example,…) = so again this

6

Page 7: Web viewA difference between origins GDP and destination GDPs is expected, a lower estimation for importer GDPs would suggest evidence of home market effects

approach is only valid when the interest is on bilateral / country pair coefficients

lnX ijt=a0+a1 I ¿+a2 I jt+a3 ln (t¿¿ ij)+(a4 I t )+εij ¿

3.- To proxy MTR with remoteness indexes, computed as the (GDP weighted) average distance of trader “i” to all countries/regions other than “j” (and vice versa).

REM i=∑m≠ j

❑ d ℑ

Y m or REM i=∑

j

d ijY j/Y

o It is the only option if we are interested in country – specific variables (country specific dummies would preclude the estimation of such parameters)

o Two major drawbacks: Resistance to trade is measured only with distance Difficult to find a good way of measuring distance “ii”

Can we use a standard panel data approach with FE/RE (or other) estimators? :

- Using Fixed Effects or RE standard Panel Data estimator.

o Yes, and apart from controlling MTR terms, the use of standard Panel Data estimations help us to control, in addition, for bilateral / country pair heterogeneity (bilateral / country pair fixed effects)….. BUT ATTENTION: those country pair time invariant effects cannot be estimated with Fixed Effects panel data estimator if our interest relies on other time invariant bilateral variables (such as borders, common language, trade agreement,….)

o The use of RE is an option if we want to get time invariant coefficients (at the risk, as ever, of bias in coefficients)

4.- OTHER EMPIRICAL (more advanced) ISSUES.

- There are a handful of issues of (sometimes critical) interest:

o How to deal with of zero tradeo Bias for log model estimation in the (highly probable) presence of

heteroskedasticity o Some extra-cautions when working with disaggregated data such as

sectors, firms,…o Endogeneity in gravity equation: causation between trade and trade

policy could be reversed when, for example in the case of the signature of a FTA, there exist a selection of countries based on intensity of trade, and not the other way round.

o Spatial correlation

7

Page 8: Web viewA difference between origins GDP and destination GDPs is expected, a lower estimation for importer GDPs would suggest evidence of home market effects

o Omitted variables biasing coefficients systematically (relationship between trade and migration, for example)

o Several authors have proposed a dynamic gravity equation in place of the traditional static gravity equation

o …..and some others….

- How to deal with zeros:

- Reasons for zeros:

o Real zero tradeo Rounded to zero tradeo Missing values for sometimes unknown reasons (non reported by

countries, error in dissemination or manipulation,….)….The problem is that, in many times, the researcher doesn’t know what proportions of different types of zeroes does he have in his dataset.

- Alternatives:

o Simply truncate the sample to avoid zero cases (delete “ij” cases with zeroes): only OK if zeros are true missings and thus randomly distributed across “n” and “t”

o Substitute zeros by small numbers (1, for example): only appropriate if real zero or almost zero trade BUT arbitrary level generate unexpected impact on parameters

o Not to use logs, and estimate the model in levels:

With a linear estimator. NO: theoretical foundation of the gravity equation implies multiplicative form

With a non-linear estimator: (Pseudo) Poisson maximum likelihood (ML) estimator

applied to the levels of trade estimating directly the non- linear form6.

Tobit (that allows a significant proportion of zeros) on the log of trade plus a constant: the critique is that Tobit is applies for left-censored zeros only when those have the economical meaning of zeros (no trade or almost no trade because of prohibitive trade costs, for example)

o To control for the “selection bias” using a Heckman procedure (Heckman 2- stages least squared estimation that introduces in the specification the

6 Silva, J. S., & Tenreyro, S. (2006). The log of gravity. The Review of Economics and statistics, 88(4), 641-658.

8

Page 9: Web viewA difference between origins GDP and destination GDPs is expected, a lower estimation for importer GDPs would suggest evidence of home market effects

inverse of the so called Mills ratio). However, that method requires “instrumental” variables that may explain the selection (zero or positive trade) but not the value of positive trade.

- Log inducing bias in presence of heteroskedasticity

The Gravity model is basically defined as:

X ij=α0Y iα 1Y j

α2Dijα 3 εij

Where the random term εij have the standard property:

E [εij /Y iY j Dij]=1

The model is then usually linearized taking the following simple form:

lnX ij=α0+α1 lnY i+α 2lnY j+α 3lnD ij+ ln (εij )

- The problem is that, as Jansen’s inequality states, E[ln(ε)]≠lnE[ε]. The expectation of a log of a random variable E[ln(ε)] not only depends on the mean of that variable E[ε] but also on higher order moments (such as the variance) V[ε]. Then when the random term in the original (nonlinear) model presents heteroskedasticity,

V [εij ]=σ ij=f (Y i ,Y j , Dij)

Then the expected value of its logarithm E[ln(ε)], that is also a function of σij, is also a function of the explanatory variables:

E [ ln ( εij) ]= f (σ ij )= f (Y i ,Y j ,Dij )

The result is therefore that some of the parameters in the log model might be biased and inconsistent.

- A way of solving this problem is to assume a pattern of heteroskedasticity where conditional variance depends on conditional mean, that is, a Poisson distribution for the endogenous variable where E[yi/X]=V[yi/X]. Then a PPML (Poisson pseudo- maximum likelihood estimator) traditionally used for count data can be used to consistently estimate the model. One interesting extra - point is that this estimator is applied for the model in LEVELS so no logs are needed and thus, at the same time, we fix the problem of zeros.

9

Page 10: Web viewA difference between origins GDP and destination GDPs is expected, a lower estimation for importer GDPs would suggest evidence of home market effects

10

Page 11: Web viewA difference between origins GDP and destination GDPs is expected, a lower estimation for importer GDPs would suggest evidence of home market effects

5.- EMPIRICAL EXERCISES USUALLY COVERED WITH GRAVITY MODELING

- Simulate scenarios for international trade adjustment according to changes in main explanatory variables

- Quantify trade potential between two countries. Basically, a gravity equation is used using data only of those countries that may have supposedly reached their trade potential and then, after some adjustments, the estimated equation is applied to pair of countries out of the sample: the real trade is then compared with predicted (potential) trade.

- Evaluate / Quantify the impact of policy issues: Free Trade Agreement, Tariff cuts/rises (Only make sense in the case of a specific product ), Currency unions, Political blocs, patent rights, and other various trade distortions.

- Measure bilateral trade resistance / cost. A gravity equation can also be used “in reverse” to measure bilateral trade costs at an aggregate level. The idea is to solve a theoretical gravity equation for the trade costs term instead of trade flows and to express these costs as a function of the observable trade data and this allows to estimate the tariff equivalent of non tariff barriers

11

Page 12: Web viewA difference between origins GDP and destination GDPs is expected, a lower estimation for importer GDPs would suggest evidence of home market effects

STATA HANDS ON SESSION

DO File: DO_MANIPULATION_COMMENTED

MANIPULATION OF DATA (Previous to Econometrics)

(Steps 1 to 7 as described in Chapter 3 – UNCTAD/WTO.)

Several operations to perform before estimation (see DO_MANIPULATION_COMMENTED):

- Download datasets from sources and import them into a single software format (stata dta, E-Views wf,..)

- Homogenize formats of different datasets, list of countries, names for countries, names for variables, “names” for years

- Replace missings (ceros for trade, for example or functional 999 for real missings, year of WTO accession for example)

- Generate the structure for the gravity model data set: all possible combinations of countries and years (if panel) adapting different structures

- Merge different files into a single one- Generate dummies for year, country, and year-country- Compute log variables (for GDP, trade and distance)

Step 1:

- Import CSV trade flows (tradeflows.csv), label variables and save to .dta - Import txt file “joinwto.txt” with year of accession for each country and save it in .dta

format- Import CSV file “GDP.csv” with GDP data for each countries from 1960 to 2006, replace

BELGIUM and LUXEMBOURG by BENELUX, compute BENELUX GDP with the sum of both countries and change names for year variables save it in .dta format

- Open STATA datafile containing the rest of explanatory variables, fix BENELUX problem, change some variable names, label some other variables and save it in .dta format

Basically, at the end of that Step 1, four different STATA files are created and stored in the default directory:

1. tradeflows.dta (endogenous variable) in a Panel dataset for YEARS and PAIRS of countries in LONG format

12

Page 13: Web viewA difference between origins GDP and destination GDPs is expected, a lower estimation for importer GDPs would suggest evidence of home market effects

2. joinwto.dta (explanatory variable wtoaccesion) in a Cross Section dataset for INDIVIDUAL countries

3. GDP.dta (explanatory variables GDP’s) in a Panel dataset for YEARS and INDIVIDUAL countries in WIDE format

4. CEPII.dta (other explanatory variables in LONG format) in a Cross Section dataset for PAIRS of countries

13

Page 14: Web viewA difference between origins GDP and destination GDPs is expected, a lower estimation for importer GDPs would suggest evidence of home market effects

Step 2:

- Starting with “tradeflows.dta”, create the FULL structure of the datafile: PANEL DATA for YEARS and every possible combination (PAIR) of countries filling with “zeros” the pairs newly created. The temporary file created is "gravity_temp1.dta"

Step 3:

- Reshape GDP.dta to LONG Panel set and create a duplicate (GDP is going to be used as both importers’s GDP and exporter’s GDP)

reshape long stub, i(i) j(j)\

j new variablereshape long yr, i(countrycode) j(year)rename yr gdp

- And MERGE those two new files (“GDP_exporter.dta” and “GDP_importer.dta”) with "gravity_temp1.dta" keeping those observations (PAIRS of countries) with information in both files.

14

Page 15: Web viewA difference between origins GDP and destination GDPs is expected, a lower estimation for importer GDPs would suggest evidence of home market effects

- MERGE “joinWTA.dta” with that file creating two new variables: join_exporter and join_importer .

- The new temporary file created is "gravity_temp3.dta"

Step 4:

- MERGE data of both two new files “CEPII.dta” (previously saved) and “religion.dta” with the previous.

- The new temporary file created is "gravity_temp4.dta"

Step 5:

- Create WTO accession dummies depending on whether one, none or both countries are members of WTO or not (onein, nonein, bothin)

- The new PERMANENT file created is "gravity.dta" and basically contains the core dataset (endogenous and exogenous variables, except for country/country x time/time dummies and some lasting transformations)

Step 6:

- Create country/country x time/time dummies for the specification of MTR terms and time fixed effects

- In this block, due to memory restrictions, three different options are offered if the number of dummies exceed the STATA capacity: o Option selected in this example: Reduce the number of years (>1995→1996 – 2005)o Compute country-period (and not country-year dummies) o Make a balanced panel (reducing the sample to those countries having the

information for the same time period).

15

Page 16: Web viewA difference between origins GDP and destination GDPs is expected, a lower estimation for importer GDPs would suggest evidence of home market effects

Step 7:

- Create logs of variables GDP’s, and distance- Compute five year average of some variables - Create a subset with OECD countries for the period 2000-2005

ECONOMETRIC ESTIMATIONS OF GRAVITY EQUATIONS

- Load dataset “gravity_OECD_2000_2005.dta” - REG1: ESTIMATE A CROSS SECTION BASIC REGRESION AND PERFORM SOME BASIC

CHECKS:o Estimate the simplest log-linear gravity model regression for the year 2005 using only

lgdp_exporter, lgdp_importer and ldistance and interpret parameters/elasticitieso Check if GDP elasticities are close to unitary as predicted by theory:

Theory predicts a value around 1 for both elasticities A difference between origins GDP and destination GDPs is expected, a lower

estimation for importer GDPs would suggest evidence of home market effects (due to barriers to entry or national product differentiation).

o Check if trade elasticity is significantly more sensible to trade barriers in 2005 than in 2000

Procedure: compare basic estimation for different years (2000 Vs 2005) using seemingly unrelated estimation (STATA suest command)

META analysis for 2500 gravity equations estimations. Table extracted from Head, K., & Mayer, T. (2013). Gravity equations: Workhorse,

toolkit, and cookbook. Handbook of international economics, 4.

- REG2: ESTIMATE ANOTHER CROSS SECTION REGRESSION WITH ADDITIONAL VARIABLES

o Estimate, with robust inference, for 2005 adding more variables:reg limports contig comlang_off onein colony REPlandlocked PARTlandlocked religion ldist lgdp* if year==2005, robust

o Compare REG1 and REG2 regressions7 o Check elasticities obtained:

7 For that, it is useful to download “eststo” command

16

Page 17: Web viewA difference between origins GDP and destination GDPs is expected, a lower estimation for importer GDPs would suggest evidence of home market effects

How do you compute the elasticity for dummy variables? Adjacency coefficient usually lies in the vicinity of 0.5 (Head, K 2003)

suggesting that trade is about 65% higher as a result of sharing a border. To omit this variable may cause an upward bias in distance parameter (both are negatively related to each other)

Contiguity and common language effects seem to have very comparable effects, with coefficients around 0.5, about half the effects of colonial links. (Head, K., & Mayer, T. (2013), see table above))

According to some papers, common links (lenguaje, colony,…) may cause very significant rises in trade (up to two, three times or even more…)

The effect of FT agreements may also have a very significant impact on trade (for obvious reasons) but the size depends crucially in a long list of different features about this FTA: large estimated effects albeit with large standard deviations.

- REG3: ADDING DUMMIES TO CONTROL FOR MTR EFFECT

o Keep only 2000 - 2005 observations with origin or destination an OECD country o 3.1 Try to estimate REG2, with robust inference, for a cross section in 2005 adding

country dummies importer_* and exporter_* to control for MTR with country fixed effects (add also year* dummies)

We cannot include other country specifics variables such as REPlandlocked PARTlandlocked lgdp_importer lgdp_exporter

o 3.2 How can we estimate the parameters of country specifics?. A pooled OLS regression for a short period (2000-2005) could be a solution for country specific that varies over time (GDP’s for example, but not for country time-invariant variables (such as REPlandlocked, PARTlandlocked)

Repeat previous regression for the period 2000-2005o 3.3. What if we now add country x time dummies allowing for MTR time variants?

The answer is that, now we cannot estimate neither country specific time – invariant (including country dummies) or country specific time - variant coefficients (such as GDP’s)

o 3.4. What if we now add country-pair dummies allowing to control for paired heterogeneity?

Adding “pairid” fixed effects does not allow to estimate the coefficients for “country pairs” such as distance, colony, onein,…..

SO IF WE CONTROL FOR ALL FIXED EFFECTS AT THE SAME TIME (COUNTRY, YEAR, COUNTRY X YEAR, AND COUNTRY-PAIRS) WE THEN LOSE THE REST OF PARAMETERS (except for fixed effects)

o Compare common coefficients for the four regression reg2, reg3.1, reg3.2, reg3.3 and reg3.4

o Results comparing common coefficients (when we can) suggest: the distance coefficient is biased towards zero empirically when committing

the mistake of not controlling for MTR terms and, on the contrary, GDP’s effects seems quite relevant positive bias.

- REG4: PANEL DATA (Step 8 in UNCTAD-WTO document)

o Set panel data structure

17

Page 18: Web viewA difference between origins GDP and destination GDPs is expected, a lower estimation for importer GDPs would suggest evidence of home market effects

o Estimate with panel data fixed effects including, also, time effects for controlling global economic effects and time-varying fixed effects both for the exporter and the importer

o Using fixed effects, we will lose the possibility to estimate country – paired variables (at least using fixed effects).

o Consider the possibility of RE Vs FE doing a Haussman test or Seemly Uncorrelated Regressions.

SIMULATION EXERCISE: EFFECT OF RTA (Nafta) 8

“The gravity equation provides a way of looking for evidence of trade diversion through the ex-post analysis of trade flows. Suppose that countries “i” and “j” belong to a common RTA, whereas country “k” does not. If, after the RTA’s formation, “i” imports more from “j” and less from “k”, trade diversion is likely. If, in contrast, country “i” imports more from “j” and from “k”, trade creation is likely”.

- A data file (agGravityData.dta) should be previously constructed according to instructions of pg.131.d.1.1

- We open the data file (already created):

use "agGravityData.dta", clear

- Create NAFTA dummies for intra-trade and for imports of NAFTA members from other countries

gen nafta = (ccode=="CAN" | ccode=="MEX" | ccode=="USA") label var nafta "1 if home is nafta member"gen pnafta = (pcode=="CAN" | pcode=="MEX" | pcode=="USA") label var pnafta "1 if partner is nafta member"gen intra_nafta = (ccode=="CAN" | ccode=="MEX" | ccode=="USA") & (pcode=="CAN" | pcode=="MEX" | pcode=="USA") replace intra_nafta = 0 if year < 1994label var intra_nafta "1 if trade bewteen nafta members"gen imp_nafta_rest = (ccode=="CAN" | ccode=="MEX" | ccode=="USA") & (pcode!="CAN" & pcode!="MEX" & pcode!="USA") replace imp_nafta_rest = 0 if year < 1994label var imp_nafta_rest "1 if nafta's imports from the rest of the world"

- Declare a panel (or times series panel), generate some logarithms

egen id = group(ccode pcode)tsset id yeargen lnV = log(imp_tv)label var lnV "value of imported goods in logarithm"gen lncGDP = log(cgdp_current)label var lncGDP "partner's current GDP in logarithm"gen lnpGDP = log(pgdp_current)label var lnpGDP "home's current GDP in logarithm"gen lnD = log(km)label var lnD "bilateral distance in logarithm"

- And estimate a gravity equation for logarithms of value of imports (lnV) including logs of GDPs, distance, both NAFTA dummies, year dummies and fixed effects for pairs of countries. The interpretation of both coefficients might be used as an empirical test about trade creation and/or trade diversion.

8 A regional trilateral trade agreement signed by Canada, Mexico, and the United States, that came into force on January 1, 1994.

18

Page 19: Web viewA difference between origins GDP and destination GDPs is expected, a lower estimation for importer GDPs would suggest evidence of home market effects

xtreg lnV lncGDP lnpGDP lnD intra_nafta imp_nafta_rest _Iyear_*, fe robust

- We then interact NAFTA dummies with years in order to see the changes of NAFTA impacts along time

xi: xtreg lnV lncGDP lnpGDP lnD i.year i.year*intra_nafta i.year*imp_nafta_rest , fe vce(robust)

- Finally, we also follow similar structure to test export diversion, generating the dummy capturing the exports of NAFTA towards the rest of the world

gen exp_nafta_rest = (pcode=="CAN" | pcode=="MEX" | pcode=="USA") & (ccode!="CAN" & ccode!="MEX" & ccode!="USA") replace exp_nafta_rest = 0 if year < 1994label var exp_nafta_rest "1 if nafta's exports to the rest of the world"

- And running the previous regression including this new dummy

xtreg lnV lncGDP lnpGDP lnD intra_nafta imp_nafta_rest exp_nafta_rest _Iyear_*, fe robust

19