Package 'tradepolicy'

Title: Replication of 'An Advanced Guide To Trade Policy Analysis'
Description: Datasets from Yotov, et al. (2016) <isbn:978-92-870-4367-2> (An Advanced Guide to Trade Policy Analysis) and functions to report regression summaries with clustered robust standard errors.
Authors: Mauricio Vargas Sepulveda [aut, cre] , Alexey Kravchenko [ths], Constanza Prado [ths], Yoto Yotov [ths], The United Nations [dtc, cph, fnd]
Maintainer: Mauricio Vargas Sepulveda <[email protected]>
License: CC BY 4.0
Version: 0.7.0
Built: 2024-10-31 05:06:38 UTC
Source: https://github.com/pachadotdev/tradepolicy

Help Index


International Trade Data for Application Exercises in AGTPA

Description

Contains bilateral trade flows for different pairs of countries between 1986 and 2006 and additional variables modelling.

Format

A data frame with 99,981 rows and 17 columns:

exporter

Exporter ISO country code

importer

Importer ISO country code

pair_id

Symmetric Pair ID

year

Year

trade

Nominal trade flows in current US dollars

dist

Population-weighted bilateral distance between country 'i' and 'j', in kilometers

cntg

Indicator. Equal to 1 if country 'i' and 'j' share a common border

lang

Indicator. Equal to 1 if country 'i' and 'j' speak the same official language

clny

Indicator. Equal to 1 if country 'i' and 'j' share a colonial relationship

rta

Indicator that is equal to one when country 'i' and 'j' are members of same Regional Trade Agreement

rta_lag3

3rd lag of RTA

rta_lag4

4th lag of RTA

rta_lag6

6th lag of RTA

rta_lag8

8th lag of RTA

rta_lag9

9th lag of RTA

rta_lag12

12th lag of RTA

rta_lead4

4th lead of RTA

Details

The data was drawn from the WDI for the year 2005 (earliest year available), the countries with no entry cost data are mainly small probably not in service trade data, and there are some considerations for the countries in this dataset:

  • KOR designates RKO since 1949

  • RUS designates SUN between 1949 and 1991

  • CZE designates CZS between 1949 and 1992

  • DEU designates FRG between 1949 and 1989

  • Germany unified (DEU) has data since 1991

Author(s)

AGTPA authors, adapted from The World Development Index made by The World Bank


Application 1 (Traditional Gravity Estimates) Reporting Style

Description

Computes clustered standard errors, tests on coefficients with clustered standard errors and obtains RESET test p-value.

Usage

tp_summary_app_1(
  formula,
  data,
  method = "ppml",
  pair = "pair_id",
  etfe = "exp_year",
  itfe = "imp_year"
)

Arguments

formula

Formula for the model

data

Tibble or data.frame

method

Regression method, which can be "ols" or "ppml" (default)

pair

Inter-national fixed effects column (defaults to "pair_id")

etfe

Exporter time fixed effects column (defaults to "exp_year")

itfe

Importer time fixed effects column (defaults to "imp_year")

Value

A list

Examples

# See the ebook

Application 2 (The "Distance Puzzle" Resolved) Reporting Style

Description

Computes clustered standard errors, tests on coefficients with clustered standard errors and uses the delta method to obtain changes in time-based distance estimated coefficients.

Usage

tp_summary_app_2(
  formula,
  data,
  method = "ppml",
  pair = "pair_id",
  etfe = "exp_year",
  itfe = "imp_year",
  dist = "log_dist",
  intr = "log_dist_intra",
  csfe = "intra_pair"
)

Arguments

formula

Formula for the model

data

Tibble or data.frame

method

Regression method (lm or glm)

pair

Inter-national fixed effects column (defaults to "pair_id")

etfe

Exporter time fixed effects column (defaults to "exp_year")

itfe

Importer time fixed effects column (defaults to "imp_year")

dist

Distance column (defaults to "log_dist")

intr

Intra-national distance column (defaults to "log_dist_intra")

csfe

Country-specific fixed effects (defaults to "intra_pair")

Value

A list

Examples

# See the ebook

Application 3 (Regional Trade Agreements Effects) Reporting Style

Description

Computes clustered standard errors, tests on coefficients with clustered standard errors and returns total RTAs effect with its associated standard error.

Usage

tp_summary_app_3(
  formula,
  data,
  method = "ppml",
  pair = "pair_id",
  pair2 = "pair_id_2",
  etfe = "exp_year",
  itfe = "imp_year",
  dist = "log_dist",
  intr = "log_dist_intra",
  brdr = "intl_brdr"
)

Arguments

formula

Formula for the model

data

Tibble or data.frame

method

Regression method, which can be "ols" or "ppml" (default)

pair

Inter-national fixed effects column (defaults to "pair_id")

pair2

Intra-national fixed effects column (defaults to "pair_id_2")

etfe

Exporter time fixed effects column (defaults to "exp_year")

itfe

Importer time fixed effects column (defaults to "imp_year")

dist

Distance column (defaults to "log_dist")

intr

Intra-national distance column (defaults to "log_dist_intra")

brdr

Inter-national borders column (defaults to "intl_brdr")

Value

A list

Examples

# See the ebook