fixestパッケージを用いて、重力モデルによる貿易促進効果の分析方法を示す。| 協定名 | 発効年月 | 相手国ISO3 | 備考 |
|---|---|---|---|
| 日・シンガポールEPA | 2002年11月 | SGP | 2007年9月改正議定書発効 |
| 日・メキシコEPA | 2005年4月 | MEX | 2007年4月追加議定書発効、2012年4月改正議定書発効 |
| 日・マレーシアEPA | 2006年7月 | MYS | |
| 日・チリEPA | 2007年9月 | CHL | |
| 日・タイEPA | 2007年11月 | THA | |
| 日・インドネシアEPA | 2008年7月 | IDN | |
| 日・ブルネイEPA | 2008年7月 | BRN | |
| 日ASEAN包括的経済連携(AJCEP)協定 | 2008年12月 | 順次発効 | |
| 日・フィリピンEPA | 2008年12月 | PHL | |
| 日・スイスEPA | 2009年9月 | CHE | |
| 日・ベトナムEPA | 2009年10月 | VNM | |
| 日・インド包括的経済連携協定 | 2011年8月 | IND | |
| 日・ペルーEPA | 2012年3月 | PER | |
| 日豪EPA | 2015年1月 | AUS | |
| 日・モンゴルEPA | 2016年6月 | MNG | |
| TPP(環太平洋パートナーシップ)協定 | 2016年2月 | 署名、日本は2017年1月締結 | |
| CPTPP | 2018年12月 | ||
| 日EU・EPA | 2019年2月 | ||
| 日米貿易協定・日米デジタル貿易協定 | 2020年1月 | USA | |
| 日英EPA | 2021年1月 | GBR | |
| 地域的な包括的経済連携(RCEP)協定 | 2022年1月 |
BACI1996_2015.dta)は、ここからダウンロードできる。以下のいずれかのコードでデータを読み込む。
#baci <- rio::import("BACI1996_2015.dta")
baci <- rio::import("../Data_output/BACI1996_2015.dta")
データサイズが大きく、Rがクラッシュする可能性があるため、大規模データの操作に適したdata.tableを使う。
library(data.table)
baci <- as.data.table(baci)
データは、1996年から2015年までの20年間、10の品目(HS2桁レベル)、約56の国・地域ペアから構成されている。
# yearの分布
barplot(table(baci$year), las = 2)
# 品目数の確認
barplot(table(baci$hs2), las = 2)
# 品目名の確認
table(baci$description)
##
## Animal products n.e.c. Cereals
## 17780 15020
## Coffee Dairy and eggs
## 24840 20340
## Edible nuts and fruits Edible vegetables
## 24680 23900
## Fish and aquatic invertebrates Live animals
## 24320 14340
## Meat and edible meat offal Plants and foliage
## 13460 18020
# 輸出国の確認
barplot(table(baci$exporter_iso3), las = 2)
length(unique(baci$exporter_iso3))
## [1] 56
# 輸入国の確認
barplot(table(baci$importer_iso3), las = 2)
length(unique(baci$importer_iso3))
## [1] 56
処置群を表すダミー変数treatedを作成する。日・シンガポール間の貿易の場合に1、その他の場合に0を取る。
baci$treated <- ifelse(
(baci$exporter_iso3 == "JPN" & baci$importer_iso3 == "SGP") |
(baci$exporter_iso3 == "SGP" & baci$importer_iso3 == "JPN"),
1, 0
)
table(baci$year, baci$treated)
##
## 0 1
## 1996 9818 17
## 1997 9818 17
## 1998 9818 17
## 1999 9818 17
## 2000 9818 17
## 2001 9818 17
## 2002 9818 17
## 2003 9818 17
## 2004 9818 17
## 2005 9818 17
## 2006 9818 17
## 2007 9818 17
## 2008 9818 17
## 2009 9818 17
## 2010 9818 17
## 2011 9818 17
## 2012 9818 17
## 2013 9818 17
## 2014 9818 17
## 2015 9818 17
ポワソン擬似最尤法(PPML)を用いて、重力モデルを推定する。固定効果として、輸出国×年、輸入国×年、国ペアを指定する。
年別の処置効果を推定するために、i(year, treated, 2002)を用いる。処置前年の2002年を基準年として、各年の処置効果を推定する。
処置群を表す、ダミー変数treatedを用いて、日・シンガポールEPAの貿易促進効果を分析する。
gravity_pois = fixest::fepois(value ~
i(year, treated, 2002)
| exporter_iso3^year + importer_iso3^year + pair ,
vcov = ~ exporter_iso3 + importer_iso3,
data = baci)
## NOTE: 20/0/0 fixed-effects (20 observations) removed because of only 0 outcomes or singletons.
## Warning: The VCOV matrix is not positive semi-definite and was 'fixed' (see
## ?vcov).
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 = 1996 × treated | -0.039 [0.158] |
| year = 1997 × treated | -0.208 [0.229] |
| year = 1998 × treated | -0.284 [0.197] |
| year = 1999 × treated | -0.086 [0.130] |
| year = 2000 × treated | 0.318 [0.055] *** |
| year = 2001 × treated | 0.284 [0.065] *** |
| year = 2003 × treated | -0.326 [0.159] * |
| year = 2004 × treated | -0.079 [0.057] |
| year = 2005 × treated | -0.134 [0.061] * |
| year = 2006 × treated | 0.151 [0.120] |
| year = 2007 × treated | 0.376 [0.217] + |
| year = 2008 × treated | 0.653 [0.276] * |
| year = 2009 × treated | 0.473 [0.144] ** |
| year = 2010 × treated | 0.560 [0.195] ** |
| year = 2011 × treated | 0.726 [0.114] *** |
| year = 2012 × treated | 0.873 [0.121] *** |
| year = 2013 × treated | 0.913 [0.105] *** |
| year = 2014 × treated | 0.971 [0.107] *** |
| year = 2015 × treated | 0.769 [0.215] *** |
| Num.Obs. | 196680 |
| Std.Errors | by: exporter_iso3 & importer_iso3 |
| FE: exporter_iso3^year | X |
| FE: importer_iso3^year | X |
| FE: pair | X |
fixest::iplot(gravity_pois)
i(year, treated, 2008)とする。スイスのisoコードはCHEである。i(year, treated, 2010)とする。インドのisoコードはINDである。