Joao Santos Silva Tom Zylkin
I am using trying to use two-stage estimation from Freeman et al. (2021), "Unlocking new methods to estimate country-specific trade costs and trade elasticties, Drexel working paper series, WP 2021-17".
X_i,j,t = exp[m_i,t + (P_i,t)^1-sigma + (P_j,t)^ 1-sigma) ] * e_i,j,t (1)
stage-1. Run the standard version of Gravity model
X_i,j,t = exp(D_i,j + c_i,t + k_j,t ) e_i,j,t (2)
where c_i,t and k_j,t are importer-time and exporter-time FE's to approximate (P_i,t)^1-sigma and (P_j,t)^ 1-sigma respectively.
obtain \hat(c_i,t) and \hat(k_i,t) from (2), and then by additive property of PPML, we recover the estimates of IMR [(P_i,t)^1-sigma] and OMR [(P_j,t)^1-sigma] as:
\hat [(P_i,t)^1-sigma] = Y_i,t / exp[\hat(c_i,t)] * E_0,t / Y_t (3)
and
\hat [(P_i,t)^1-sigma] = E_j,t / exp[\hat(k_j,t)] * 1/ E_0,t (4)
E_0,t is GDP of country that has been selected as numaraire, Freeman et al (2021); Anderson et al (2018)
stage-2. Substituting (P_i,t)^1-sigma and (P_j,t)^ 1-sigma by their estimates from (3) and (4) in (1), we estimate the following
X_i,j,t = exp[m_i,t +\hat [(P_i,t)^1-sigma]+ \hat [(P_i,t)^1-sigma] ] * e_i,j,t
Therefore, I ran the following code to estimate (2) as
From here onwards, I do not know the code to estimate exp#Year (k_j,t) and imp#Year (c_i,t) FE's.
After that, i need to estimate expressions in (3) and (4). Please help me with to find the estimated MRTs (P_i and P_j) in stage-1. I shall be very thankful.
I am not a STATA geek and had tried a bit of coding, but i was not able to calculate IMR and OMR, Your help will be greatly appreciated.
regards,
(Ridwan)
I am using trying to use two-stage estimation from Freeman et al. (2021), "Unlocking new methods to estimate country-specific trade costs and trade elasticties, Drexel working paper series, WP 2021-17".
X_i,j,t = exp[m_i,t + (P_i,t)^1-sigma + (P_j,t)^ 1-sigma) ] * e_i,j,t (1)
stage-1. Run the standard version of Gravity model
X_i,j,t = exp(D_i,j + c_i,t + k_j,t ) e_i,j,t (2)
where c_i,t and k_j,t are importer-time and exporter-time FE's to approximate (P_i,t)^1-sigma and (P_j,t)^ 1-sigma respectively.
obtain \hat(c_i,t) and \hat(k_i,t) from (2), and then by additive property of PPML, we recover the estimates of IMR [(P_i,t)^1-sigma] and OMR [(P_j,t)^1-sigma] as:
\hat [(P_i,t)^1-sigma] = Y_i,t / exp[\hat(c_i,t)] * E_0,t / Y_t (3)
and
\hat [(P_i,t)^1-sigma] = E_j,t / exp[\hat(k_j,t)] * 1/ E_0,t (4)
E_0,t is GDP of country that has been selected as numaraire, Freeman et al (2021); Anderson et al (2018)
stage-2. Substituting (P_i,t)^1-sigma and (P_j,t)^ 1-sigma by their estimates from (3) and (4) in (1), we estimate the following
X_i,j,t = exp[m_i,t +\hat [(P_i,t)^1-sigma]+ \hat [(P_i,t)^1-sigma] ] * e_i,j,t
Therefore, I ran the following code to estimate (2) as
Code:
cap egen exp = group(iso_e) cap egen imp = group(iso_i)
Code:
ppmlhdfe Trade_Value ln_distwces contig comlang_off colony comcol, absorb(exp#Year imp#Year) d cluster(distwces) nolog
From here onwards, I do not know the code to estimate exp#Year (k_j,t) and imp#Year (c_i,t) FE's.
After that, i need to estimate expressions in (3) and (4). Please help me with to find the estimated MRTs (P_i and P_j) in stage-1. I shall be very thankful.
I am not a STATA geek and had tried a bit of coding, but i was not able to calculate IMR and OMR, Your help will be greatly appreciated.
regards,
(Ridwan)
Comment