This version: 2024-11-09

1 はじめに

本ページでは、政策が2国間の貿易額に与える影響が経時的にどう変化するか分析するため、単純な差の差 (DiD: difference-in-differences) 分析を拡張したevent study分析を実施する。 Anderson and Van Wincoop (2003) が指摘した多角的貿易抵抗指数(物価効果)を制御するために、時変の輸出国(輸入国)固定効果、貿易ペアの固定効果、さらには年次固定効果を加えて、重力方程式をポワソン擬似最尤法(PPML)で推定する。

本ページでは、1958年1月1日に、ローマ条約が発効し、欧州経済共同体(EEC、のちの欧州共同体 (EC))が発足した事例を用いて、EEC発足が2国間貿易に与えた影響を推定する。EEC発足は、1958年という単一時点のため、本ページで扱う処置は時差のない処置である。時差のある処置の場合は、処置効果の推定はより難しくなるが、本ページで扱う時差のない処置は、そうした困難はない。

推定には、本ページでは、Berge and McDermott (2023) によって開発されたfixestパッケージを用いる。 パッケージのインストールのインストールは以下のコードで行われる。

install.packages("fixest")

パッケージの読み込みを行う。

# パッケージの読み込み
library(fixest)

2 貿易データ

gravityIMFeu.dtaには、フランスの研究機関CEPIIが作成している、Gravityという無料のデータベースから、2国間の貿易額やRTAの有無など必要最小限のデータを抜き出している。gravityIMFeu.dtaには、1948–1972年の25年間の世界の2国間の貿易額 (tradeflow_imf_d, tradeflow_imf_o) が収録されている。今回は古い期間の貿易データを用いるため、1996年からしかデータがないCEPIIが作成した貿易データ(tradeflow_baci) ではなく、IMFの貿易データ(tradeflow_imf_d) を用いる。また、一般に、関税計算のために目的地の貿易統計の方が正確であると言われているので、目的地の貿易額 (tradeflow_imf_d) を分析に用いる。

Gravityデータベースは定期的に更新されている。本ページで用いるデータは、「Gravity_dta_V202211」版であり、2024年3月に入手した。主な変数は以下の通りである。

  • year: Year
  • rta: 1 = RTA (source: WTO)
  • pair: group(iso3_o iso3_d)
  • iso3_o: Origin ISO3 alphabetic
  • iso3_d: Destination ISO3 alphabetic
  • gdp_o: Origin GDP (current thousands US$)
  • gdp_d: Destination GDP (current thousands US$)
  • gdpcap_o: Origin GDP per cap (current thousands US$)
  • gdpcap_d: Destination GDP per cap (current thousands US$)
  • treated_after: 1 = Both Origin and Destination EU members and after 1958
  • treated: 1 = Both Origin and Destination EU members
  • after: 1 = after 1958
  • tradeflow_imf_o: Trade flows as reported by the origin, 1000
    current USD (source: IMF)
  • tradeflow_imf_d: Trade flows as reported by the destination, 1000 current USD (source: IMF)

RでStata形式のデータ(.dta)を読み込むために、パッケージrioを用いる。rioパッケージのimport関数でdtaファイルを読み込む。

# パッケージ読み込み
library(rio)
# データ読み込み
gravityIMFeu <- rio::import("gravityIMFeu.dta")
# データ確認
head(gravityIMFeu)
##   year iso3_o iso3_d  dist contig comlang_off   gdp_o    gdp_d gdpcap_o
## 1 1948    AUS    CAN 16025      0           1      NA       NA       NA
## 2 1949    AUS    CAN 16025      0           1 6608000 16295000    0.834
## 3 1950    AUS    CAN 16025      0           1 7042000 16979000    0.852
## 4 1951    AUS    CAN 16025      0           1 7458000 20551000    0.876
## 5 1952    AUS    CAN 16025      0           1 8007000 25117000    0.921
## 6 1953    AUS    CAN 16025      0           1 9137000 26276999    1.032
##   gdpcap_d gatt_o gatt_d wto_o wto_d eu_o eu_d rta rta_coverage rta_type
## 1       NA      1      1     0     0    0    0   0           NA       NA
## 2    1.210      1      1     0     0    0    0   0           NA       NA
## 3    1.212      1      1     0     0    0    0   0           NA       NA
## 4    1.434      1      1     0     0    0    0   0           NA       NA
## 5    1.699      1      1     0     0    0    0   0           NA       NA
## 6    1.731      1      1     0     0    0    0   0           NA       NA
##   tradeflow_imf_o tradeflow_imf_d pair treated_after treated after
## 1           26000           30100 1604             0       0     0
## 2           26600           29200 1604             0       0     0
## 3           24100           33600 1604             0       0     0
## 4           36300           48100 1604             0       0     0
## 5           19100           21100 1604             0       0     0
## 6           24600           26200 1604             0       0     0

3 分析の枠組み

処置群は、輸出国・輸入国の両方が、ドイツ(DEU)、フランス(FRA)、イタリア( ITA)、オランダ(NLD)である2国間域内貿易である。制御群は、輸出国・輸入国のいずれか、もしくは両方が、ドイツ・フランス・イタリア・オランダではない2国間貿易である。1958年1月1日に、ローマ条約が発効し、欧州経済共同体(EEC、のちの欧州共同体 (EC))発足した。そのため、1948–1957は、処置前期間(before)、1958–1972は処置後期間(after)である。

Before

1948–1957

After

1958–1972

EEC非加盟国 A0 A1 A1-A0
EEC加盟国 B0 B1 B1-B0
B0-A0 B1-A1 (B1-B0)-(A1-A0)

4 多期間への拡張

処置群と制御群の貿易額の年平均値をまとめたデータセットをdoByパッケージを用いて作成する。使用方法は、UCLAのページに解説がある。

まず、doByパッケージをインストールする。

install.packages("doBy")
library(doBy)
collapse <- doBy::summaryBy(tradeflow_imf_d ~ treated + year, data = gravityIMFeu)

処置群と制御群の貿易の推移をplot関数で折れ線グラフにする。EEC発足の1958年にabline(v=1958)により縦線を入れる。なお、縦線(vertical line)は、abline(v = x)を使うが、横線(horizontal line)を入れる場合は、abline(h = y)を用いる。

treated <- subset(collapse,treated==1)
control <- subset(collapse,treated==0)

plot(treated$year, log(treated$tradeflow_imf_d.mean),type = "o", ylim=c(8,15), col=4, xlab = "period", ylab="Trade values")
points(control$year,log(control$tradeflow_imf_d.mean),type = "o", col=1)
abline(v=1958)
text(1960,14,"treated")
text(1960,10,"control")

5 イベント・スタディ・プロット

ポアソン擬似最尤(PPML)推定法を用いた重力方程式の固定効果アプローチ推定を行い、イベント・スタディ・プロット (Event study plot) を描く。ここで、i(fact_var, num_var, reference) 構文を用いて、年次変数yearと処置グループを表すダミー変数treatedを指定している。基準となるreferenceにはEEC発足前年の1957年を指定している。

gravity_pois = fixest::fepois(tradeflow_imf_d ~  
                        i(year, treated, 1957) 
                      | iso3_o^year + iso3_d^year + pair, 
                      vcov = ~ iso3_o + iso3_d,
                      data = gravityIMFeu)

結果はprintもしくはsummaryでも直接表示できるが、modelsummaryで表示する。

library(modelsummary)
modelsummary::modelsummary(gravity_pois,
             estimate  = "{estimate} [{std.error}] {stars}",
             statistic = NULL, # 係数の下に何も表示しない
             coef_omit = "Intercept|.*factor",
             gof_omit = 'DF|Deviance|Log.Lik.|RMSE|AIC|BIC|R2 Within|R2 Within Adj. ')
 (1)
year = 1948 × treated −0.133 [0.304]
year = 1949 × treated 0.021 [0.254]
year = 1950 × treated 0.273 [0.159] +
year = 1951 × treated −0.063 [0.112]
year = 1952 × treated −0.066 [0.073]
year = 1953 × treated 0.058 [0.061]
year = 1954 × treated 0.071 [0.060]
year = 1955 × treated 0.083 [0.038] *
year = 1956 × treated 0.017 [0.007] *
year = 1958 × treated −0.020 [0.034]
year = 1959 × treated 0.157 [0.066] *
year = 1960 × treated 0.177 [0.061] **
year = 1961 × treated 0.246 [0.068] ***
year = 1962 × treated 0.297 [0.079] ***
year = 1963 × treated 0.348 [0.075] ***
year = 1964 × treated 0.395 [0.092] ***
year = 1965 × treated 0.440 [0.103] ***
year = 1966 × treated 0.497 [0.108] ***
year = 1967 × treated 0.564 [0.107] ***
year = 1968 × treated 0.620 [0.126] ***
year = 1969 × treated 0.702 [0.130] ***
year = 1970 × treated 0.672 [0.139] ***
year = 1971 × treated 0.715 [0.157] ***
year = 1972 × treated 0.749 [0.165] ***
Num.Obs. 18450
Std.Errors by: iso3_o & iso3_d
FE: iso3_o^year X
FE: iso3_d^year X
FE: pair X

関数 iplot は、i() で作成された変数の係数を表示し、その係数のみを表示する。すべての係数を表示したい場合は、代わりに coefplot 関数を使用する。iplotを用いて、描いたイベント・スタディ・プロットから、EEC加盟により、域内貿易が制御群に比べて、年々増加していることがわかる。一方で、処置前の係数が正に有意である年(1955, 1956年)もあり、パラレル・トレンドは成立していないと考えられる。

fixest::iplot(gravity_pois)

参考文献

Anderson, James E, and Eric Van Wincoop. 2003. “Gravity with Gravitas: A Solution to the Border Puzzle.” American Economic Review 93 (1): 170–92. https://doi.org/10.1257/000282803321455214.
Berge, Laurent, and Grant McDermott. 2023. “Fast Fixed-Effects Estimation: Short Introduction.” https://cran.r-project.org/web/packages/fixest/vignettes/fixest_walkthrough.html.