Dear Stata users,
I am running a gravity model on EU imports with trade volume at 6-digit HS as dependent variable and variables such as rta (dummy), ln(1+tariff) and no. of non-tariff-measures as independent ones. I consider 4 different type of ntms (exporter affecting SPS, importer affecting SPS, exporter affecting TBT and importer affecting TBT) e and, for each of them, I estimate 4 country-specific coefficients (DEU, ESP, ITA, FRA) and one for all the other EUcountries.
After estimating the coefficients, I compute the predicted values and then counterfactual scenarios in which I assume the value of ntms=0. The code for what I have described above follows:
I have two issues I would appreciate to receive a feedback on:
1) for some observations, the value of yhat are very different from actual trade
2) a non-negligible number of observations have conterfactual trade-volume effects difficult to interpret.
Is there any error in the interpretation of the coefficients of the PPML estimation? Is it a problem linked to the specification? Might it be due to the fact that I work on subsamples of the whole dataset (separate subsamples for each GTAP sector, including a minimum of 1 to a maximum of 717 hs6 codes).
Here I report the country level results for a subsample of hs6 codes (those matching the gtap code "milk") for year 2014, considering the removal of all ntms mainly affecting exporters.
Many thanks to those of you who are devoting time to reading this post.
I am running a gravity model on EU imports with trade volume at 6-digit HS as dependent variable and variables such as rta (dummy), ln(1+tariff) and no. of non-tariff-measures as independent ones. I consider 4 different type of ntms (exporter affecting SPS, importer affecting SPS, exporter affecting TBT and importer affecting TBT) e and, for each of them, I estimate 4 country-specific coefficients (DEU, ESP, ITA, FRA) and one for all the other EUcountries.
After estimating the coefficients, I compute the predicted values and then counterfactual scenarios in which I assume the value of ntms=0. The code for what I have described above follows:
Code:
gen country_2=0 replace country_2=1 if IMP_ISO3=="DEU" gen country_3=0 replace country_3=1 if IMP_ISO3=="ESP" gen country_4=0 replace country_4=1 if IMP_ISO3=="FRA" gen country_5=0 replace country_5=1 if IMP_ISO3=="ITA" forvalues i=2/5 { qui gen expTBT`i'=exp_TBTntms*country_`i' qui gen expSPS`i'=exp_SPSntms*country_`i' qui gen impTBT`i'=imp_TBTntms*country_`i' qui gen impSPS`i'=imp_SPSntms*country_`i' } ppmlhdfe trade exp_SPSntms expSPS* imp_SPSntms impSPS* exp_TBTntms expTBT* imp_TBTntms impTBT* rta t, absorb(imp_id#hs6#year aff_id#hs6#year imp_id#aff_id#hs6) vce(cluster imp_id#aff_id#hs6) d predict yhat, mu gen counter_expSPS=yhat replace counter_expSPS=yhat/exp(_b[exp_SPSntms]*exp_SPSntms+_b[expSPS2]*expSPS2+_b[expSPS3]*expSPS3+_b[expSPS4]*expSPS4+_b[expSPS5]*expSPS5)
1) for some observations, the value of yhat are very different from actual trade
2) a non-negligible number of observations have conterfactual trade-volume effects difficult to interpret.
Is there any error in the interpretation of the coefficients of the PPML estimation? Is it a problem linked to the specification? Might it be due to the fact that I work on subsamples of the whole dataset (separate subsamples for each GTAP sector, including a minimum of 1 to a maximum of 717 hs6 codes).
Here I report the country level results for a subsample of hs6 codes (those matching the gtap code "milk") for year 2014, considering the removal of all ntms mainly affecting exporters.
Code:
keep if year==2014 keep if IMP_ISO3=="DEU" | IMP_ISO3=="ESP" | IMP_ISO3=="FRA" | IMP_ISO3=="ITA" bysort IMP_ISO3: egen tot_actualtrade=total(trade) bysort IMP_ISO3: egen tot_yhat=total(yhat) bysort IMP_ISO3: egen tot_counterf=total(counter_expSPS) duplicates drop IMP_ISO3, force gen ntms_tve=100*(tot_counterf/tot_yhat -1)
country | actual trade (A) | predicted trade (B) | counterfactual trade (C) | % change (C/B-1)*100 |
DEU | 650679.44 | 641199.03 | 576603.99 | -10.074102 |
ESP | 290979.46 | 290658.39 | 290982.11 | .11137613 |
FRA | 428603.21 | 409767.92 | 403588.13 | -1.5081182 |
ITA | 458814.12 | 457228.43 | 9.770e+09 | 2136701.9 |
Comment