Hands-on Gravity Estimation With STATA

2y ago
40 Views
2 Downloads
399.15 KB
11 Pages
Last View : 17d ago
Last Download : 2m ago
Upload by : Albert Barnett
Transcription

AGRODEP Technical Note TN-05April 2013Hands-on gravity estimation with STATAVersion 2Maria Cipollina and Luca SalvaticiAGRODEP Technical Notes are designed to document state-of-the-art tools andmethods. They are circulated in order to help AGRODEP members address technicalissues in their use of models and data. The Technical Notes have been reviewed buthave not been subject to a formal external peer review via IFPRI’s PublicationsReview Committee; any opinions expressed are those of the author(s) and do notnecessarily reflect the opinions of AGRODEP or of IFPRI.

Hands-on gravity estimation with STATAIn this document we give several examples of hands-on estimation to familiarize yourselfwith the gravity equation methodological choices highlighted in the literature review. Thisguide provides an illustrative dataset with alternative Stata codes presenting the differentpossible estimation strategies.Part 1 describes how estimations are carried out with panel data and are directed to show therelevance of the multilateral resistance term as well as the modeling of the (trade) policyvariables. In Part 2, cross-sections estimations show the importance of working withdisaggregated data. Finally, Part 3 shows how you can solve the ‘zero (trade flows) problem’using either Heckman or Poisson estimators.As you read this guide, you will use STATA to carry out estimations designed to familiarizeyou with the software and, more importantly, the gravity model. STATA is a statisticalsoftware program and we assume that you have a recent version of STATA (version 11.2 orlater). The instructions in this guide are quite detailed. Our aim is to give sufficient detail toenable a new user of this software to follow the examples relying solely on this guide. On theother hand, the guide is strictly related to the literature review that highlights the maintheoretical and methodological issues illustrated in the regressions.Data filesThere are two Data files: dataset def.dta: it contains all the essential variables used in the regressions usingpanel data (Part 1). The dataset covers the period from 1996 to 2006 and includes 154developed and developing countries. us agr.dta: it contains all the essential variables used in the regressions using crosssection data (Part 2 and Part 3). It refers to year 2004 US agricultural imports from226 countries. Data are disaggregated at the most detailed level allowed by theinternational Harmonized System (HS) classification (6 digits) and include 689products.The variable names are largely self-explanatory and are described when the labels arecreated: their generation and construction can thus be directly inspected. The data sources aredescribed in the Appendix.

Do filesThere are three Do files: regressions aggregated data.do: it runs regressions using panel, aggregated data (Part1). regressions disaggregated data.do: it runsregressions using cross-section,disaggregated as well as aggregated data (Part 2). regressions zeroes treatment.do: it runs regressions using non-linear estimators(Heckman or Poisson) dealing with ‘zero’ trade flows (Part 3).Part 1: Aggregated dataA. Variable Generation.Part A brings in the data and generates the variables used in the analysis:(a) We use the data file dataset defuse dataset def.dta(b) We take the logs of all continuous variables included in the regressions:g limports ln(imports)g lgdp o ln(gdp o)g lgdp d ln(gdp d)g ldist ln(distw)g ltariff ln(1 s average)(c) We label the variables to be included in the tables.la var limports “Ln(Imports)”la var colony “Colonial link”la var comlang off “Common language”la var contig “Border”la var ldist “Ln(distance)”la var lgdp d “Ln(GDP importer)”la var lgdp o “Ln(GDP exporter)”la var rta “Regional Trade Agreement”la var ltariff “Ln(1 Tariff)”(d) Finally, we generate the different fixed effects.qui tab imp, g(dimp)

qui tab exp, g(dexp)qui tab pair, g(dpair)qui tab year, g(dyear)B. Regression SpecificationsPart B runs panel regressions with aggregated data, and the dummy RTA (i.e., RegionalTrade Agreements) as (trade) policy variable. Regressions are based on equation (2) withtime, importer, exporter and country-pair fixed effects.We start by declaring data to be panel.tsset pair yearIn order to show the consequences of ignoring the multilateral resistance term, we firstlyestimate equation (2) without fixed effectseststo: reg limports lgdp d lgdp o ldist contig colony comlang off rta, robustThen, we introduce the different types of fixed effects:eststo: reg limports lgdp d lgdp o ldist contig colony comlang off rta dyear*, robusteststo: reg limports lgdp d lgdp o ldist contig colony comlang off rta dimp* dexp*,robusteststo: reg limports lgdp d lgdp o ldist contig colony comlang off rta dimp* dexp*dyear*,robusteststo: reg limports lgdp d lgdp o ldist contig colony comlang off rta dpair* dyear*,robustThe dummy for pair effects is equal to 1 for all observations of trade occurring between agiven pair of countries, for all pairs. Country dummies remove cross-section, but not timeseries biases. The latter is a serious shortcoming since omitted factors affecting bilateral tradecosts often vary over time. Pair dummies cannot be used in cross-section data since thenumber of dummies would be equal to the number of observations.The command “esttab” creates the regression table in a file regressions1.docesttab using regressions1.doc, title (aggregate-dummy policy) se ar2 label replace rtfb(2) star (* 0.10 ** 0.05 *** 0.01) se(2) mti drop (dexp* dimp* dyear* dpair*)TABLE: Panel results with different fixed effectsModel 1and 2 report the base regression. Column (1.1) reports results without fixed effects.Column (2.1) reports results where time dummies are added to the regression, to account for

the changing nature of the relationship over time. Column (2.2) and (2.3) show results fortime invariant importer and exporter fixed effects and for time varying exporter and importerfixed effects, respectively. Finally, column (2.4) presents a specification where pair effectsare also added.Variables1. Without FE(1.1)0.75***(0.02)(2.1)0.74***(0.02)Ln(GDP my: **(0.11)2.96***(0.85)Dummy: Colonial )6.39***(0.62)Dummy: Common 8***(0.09)6.88***(0.40)Dummy: Regional .7396.63***(0.33)YesNoNoYes77970.881Ln(GDP importer)ConstantTime feExporter feImporter feCountry-pair feObservationsAdjusted R22. With (0.15)Robust standard errors in parentheses* p 0.10, ** p 0.05, *** p 0.01All coefficients have the expected signs, the only exception is the coefficient of the coloniallinks that seem to have a negative impact if we do not consider country fixed effects(columns 1.1 and 2.1). Focusing on the most widely used specification (column 2.3), theestimated coefficients should be interpreted as follows: size of importer country has apositive and significant impact with an elasticity of 0.91, so that an increase in GDP of 10%increase trade by 9.1%; an increase in distance of 10% reduce trade by around 15%; theexistence of border and language links imply an increase in trade of 72% and 118% (e0.541 0.72; e0.78-1 1.18), respectively; the estimated coefficient of dummy for RTA of 0.62implies that regional trade agreements increase trade of 86% (e0.62-1 0.86).

Finally, in order to show the relevance of an actual measure we estimate equation (3) using acontinuous variable for trade policyreg limports lgdp d lgdp o ldist contig colony comlang off ltariff dimp* dexp*dyear*, robustThen we create the results tableesttab using regressions1.doc, title (aggregate-tariff) se ar2 label replac rtf b(2) star(* 0.10 ** 0.05 *** 0.01) se(2) mti drop (dexp* dimp* dyear*) appendTABLE: Panel results with continuous policy variableLn(Gdp importer)Ln(Gdp 43***(0.04)Dummy: Border0.62***(0.11)Dummy: Colonial link0.05(0.24)Dummy: Common language0.74***(0.09)Ln( 1 7970.743Time feExporter feImporter feObservationsAdjusted R2Robust standard errors in parentheses* p 0.10, ** p 0.05, *** p 0.01All coefficients have the expected signs. Trade policies have a negative and significantimpact on trade, a tariff factor increase by 10% leads to a 6% reduction of trade.Part 2: Disaggregated dataA. Variable Generation.(a) We use the data file us agr

use us agr.dta(b) We take the logs of all continuous variables included in the regressionsg limports ln(trade)g lgdp o ln(gdp o)g lgdp d ln(gdp d)g ldist ln(distw)g ltariff ln(1 tariff)(c) We label the variables to be included in the tables.la var limports "Ln(Imports)"la var colony "Colonial link"la var comlang off "Common language"la var contig “Border”la var ldist "Ln(distance)"la var lgdp d "Ln(GDP importer)"la var lgdp o "Ln(GDP exporter)"la var ltariff "Ln(1 Tariff)"(d) We generate the exporter and product fixed effectsqui tab exp, g(dexp)qui tab hs6, g(dhs6)B. Regression Specifications(a) As in Part 1, we firstly estimate equation (2) using the OLS estimator without fixedeffectseststo: reg limports lgdp o ldist contig colony comlang off ltariff, robust(b) Then, we introduce the different types of fixed effects:eststo: reg limports lgdp o ldist contig colony comlang off ltariff dhs6*, robusteststo: reg limports contig colony comlang off ltariff dexp* dhs6*, robust(c) Finally, we collapse the dataset in order to obtain aggregated data for a robustnessanalysis.collapse (sum) trade (mean) tariff gdp o distw contig colony comlang off, by(exp)g limports ln(trade)g lgdp o ln(gdp o)g ldist ln(distw)g ltariff ln(1 tariff)

(d) and we run again the regression to highlight the relevance of the aggregation issueeststo: reg limports lgdp o ldist contig colony comlang off ltariff, robust(e) The command “esttab” creates the regression table in a file regressions2.docesttab using regressions2.doc, title (dati us agr) se ar2 label replac rtf b(2) star (*0.10 ** 0.05 *** 0.01) se(2) mti drop (dexp* dhs6*) appendeststo clearTABLE: Cross-section results with different fixed effects and different levels of aggregationCross-sectional model covering imports in 689 agricultural commodities from 227 countriesto US in 2004.Columns (1) to (3) show results with disaggregated data using different fixed-effectsspecifications. Column (4) reports result of aggregated data.(1)0.34***(0.01)Disaggregation level: ***(0.05)Dummy: 1760.602Ln(Gdp exporter)Dummy: Colonial linkDummy: CommonlanguageLn( 1 tariff)ConstantProduct (HS6 ) feExporter feObservationsAdjusted R2(3)Aggregated data(4)1.07***(0.06)-1.96***(0.40)Standard errors in parentheses* p 0.10, ** p 0.05, *** p 0.01Most empirical analyses use gravity models with aggregated data, but using aggregatetrade flows to analyze the effects of trade policies applied at product level seems misleading.As a matter of fact, the estimated coefficient related to trade policy, namely Ln(1 tariff), isnot significant in column (4).

Part 3: Zeroes treatmentA. Variable Generation(a) We use the data file us agruse us agr.dtaWe take the logs of all continuous variables included in the regressionsg limports ln(trade)g lgdp o ln(gdp o)g lgdp d ln(gdp d)g ldist ln(distw)g ltariff ln(1 tariff)(c) We label the variables to be included in the tables.la var limports "Ln(Imports)"la var colony "Colonial link"la var comlang off "Common language"la var ldist "Ln(distance)"la var lgdp d "Ln(GDP importer)"la var lgdp o "Ln(GDP exporter)"la var ltariff "Ln(1 Tariff)"(d) We generate the exporter and product fixed effectsqui tab exp, g(dexp)qui tab hs6, g(dhs6)B. Regression Specifications(a) We firstly run the regression using the Heckman estimatoreststo: heckman limports contig colony comlang off ltariff , select(contig colony ltariff)mills(lambda)(b) Then we run the regression using the Poisson Pseudo-Maximum Likelihood estimatoreststo: ppml trade contig colony comlang off ltariff(c) The command “esttab” creates the regression table in a file regressions3.docesttab using regressions3.doc, title (treatment of zeros) se ar2 label replace rtf b(2) star(* 0.10 ** 0.05 *** 0.01) se(2) mti

TABLE: Results with different estimators: Heckman and PoissonModel (1) reports results obtained using the Heckman two-step procedure. The first columnshows the second stage estimates of the trade flow, whereas the second column reports thefirst-stage Probit selection equation. Model (2) shows results obtained using Poisson PseudoMaximum Likelihood estimator.RegressionHeckman (1)SelectionPPML(2)Dummy: : Colonial link0.76***(0.11)0.68***(0.03)1.30***(0.01)Dummy: Common language-0.09**(0.04)Ln( 1 0.01)lambda-0.58**(0.18)Observations5234052340* p 0.10, ** p 0.05, *** p 0.01The use of disaggregated data raises the “zero trade flows” issue, which introduces obviousproblems in the log-linear form of the gravity equation. Several authors consider theHeckman two-step estimator as the best procedure, others argue that gravity type modelsshould be estimated in multiplicative form, and recommend the Poisson Pseudo-MaximumLikelihood (PPML) estimator to deal with the problem of zeros in the trade matrix, in orderto achieve unbiased and consistent estimates. The significant coefficient of the Mills ratioconfirms that correcting for sample selection bias is justified, however, because of thepresence of heteroskedasticity, estimates of the log-linear form of the gravity equation arebiased and inconsistent, and this may lead to prefer the Poisson specification of the tradegravity model.

APPENDIX: Data SourceDataset ://wits.worldbank.org/wits/index.html) and on information provided by the CEPII dataset(http://www.cepii.fr/).The WITS application gives access to international trade statistics of UN COMTRADE (TheUnited Nations Commodity Trade Statistics database) and tariff database of UNCTADTRAINS (Trade Analysis and Information System).The Cepii dataset includes data on GDP and distances between countries and dummies forcontiguity, common language, and former colonial links.Us agr.dta: Data on trade and tariffs at the HS6 level of detail are taken from ). MAcMapHS6 provides a consistent worldwide assessment of protection,including ad valorem equivalent rates of specific duties and tariff rate quotas (including thoseintroduced at the end of the Uruguay Round), for 2004. Data for the remaining explanatoryvariables are from the Cepii dataset.

using either Heckman or Poisson estimators. As you read this guide, you will use STATA to carry out estimations designed to familiarize you with the software and, more importantly, the gravity model. STATA is a statistical software program and we assume that you have a recent v

Related Documents:

An indirect way of observing quantum gravity e ects is via the gauge / gravity corre-spondence, which relates quantum eld theories and quantum gravity. 1.3 Approaches to quantum gravity List of the largest existing research programmes. Semiclassical gravity Energy-momentum-t

Moreover, specific gravity is often quoted as a percentage, e.g. a specific gravity of 0.89 is shown as 89. The term API gravity(a standard adopted by the American Petroleum Institute) is commonly used to express the specific gravity of petroleum. Nota bene:API gravity is defined as: ( 141.5 / 60o specific gravity at 60o F ) – 131.5.

422HC Gravity Steam 433HC Gravity and Vacuum Steam 500HC Series 21'' (532 mm) x 21'' (532 mm) x 38'' (965 mm), 9.7 Cu Ft (275 L) 522HC Gravity Steam 533HC Gravity and Vacuum Steam DOOR SELECTION Manual Power (400 Series Double Door, Special Order) SINGLE DOOR MOUNTING Recessed Cabinet DOUBLE DOOR MOUNTING Cabinet, recessed one end

Gravity Redux: Structural Estimation of Gravity Equations with . University of Notre Dame, Notre Dame, IN 46556 USA. E-mail: bergstrand.1@nd.edu. zA–liation: Ifo Institute for Economic Research, Ludwig-Maximilian University of Munich, CESifo, and Centre for Globalization and Ec

A spreadsheet template for Three Point Estimation is available together with a Worked Example illustrating how the template is used in practice. Estimation Technique 2 - Base and Contingency Estimation Base and Contingency is an alternative estimation technique to Three Point Estimation. It is less

Introduction The EKF has been applied extensively to the field of non-linear estimation. General applicationareasmaybe divided into state-estimation and machine learning. We further di-vide machine learning into parameter estimation and dual estimation. The framework for these areas are briefly re-viewed next. State-estimation

spondence, which relates quantum eld theories and quantum gravity. 1.3 Approaches to quantum gravity List of the largest existing research programmes. Semiclassical gravity Energy-momentum-tensor is expectation value. Need self-consistent solution First step towards quantum gravity, ma

1.0 Why Buildings Move What causes structures to GRAVITY move? – In a word, gravity. Gravity is constantly working to get things closer to the ground. Strong structures resist gravity. There are two common ways a STRUCTURE structure may give in to gravity. FAILURES a) If