I'm working on a trade issue with multiple country pairs and years. my dependent variable is unit value between countries and main independent variables are tariff between countries and trade policy dummy variables.
Now I encounter a problem in my code. here is part of my codeļ¼
forvalues n == 1/380{
cap noisily qui ppml lnuv lntariff`n' intcounp`n' mp2 edds labord capitald agrid fta_wto eud wtod ADP CV QR SG SPS SSG STE TRQ XS counprod* time*, cluster(countryproduct)
capture noisily mat coef_lntariff`n' = _b[lntariff`n']
capture noisily mat coef_tariff`n' = nullmat(coef_tariff`n')\coef_lntariff`n'
capture noisily svmat coef_tariff`n', names(coef_lntariff`n')
capture noisily mat se_lntariff`n' = _se[lntariff`n']
capture noisily mat se_tariff`n' = nullmat(se_tariff`n')\se_lntariff`n'
...
in the above code, n is country pair id( n = 1, 2 , 3...). I want to save the coefficients of tariff variable(lntariff) and trade policy dummy variables(intcounp). however, in some country pairs, the tariff is all zero across my sample time, which would result to PPML drop the tariff variable(lntariff) or sometimes, this trade policy is not used in certain country pairs, which lead to trade policy dummy variable(intcounp) be zero, then again, PPML would drop this variable.
I'm wordering if there is any way to still store the coefficients of tariff variable (lntariff) and trade policy variable( intcounp) as empty cell even when they are all zero and PPML drop them.
ultimately, I want to achieve something like this:

countrypair is the country pair id variable, coef_lntariff is the coefficient of lntariff, se is the standard error...
each coefficient is corresponding to the country pair id.
Now I encounter a problem in my code. here is part of my codeļ¼
forvalues n == 1/380{
cap noisily qui ppml lnuv lntariff`n' intcounp`n' mp2 edds labord capitald agrid fta_wto eud wtod ADP CV QR SG SPS SSG STE TRQ XS counprod* time*, cluster(countryproduct)
capture noisily mat coef_lntariff`n' = _b[lntariff`n']
capture noisily mat coef_tariff`n' = nullmat(coef_tariff`n')\coef_lntariff`n'
capture noisily svmat coef_tariff`n', names(coef_lntariff`n')
capture noisily mat se_lntariff`n' = _se[lntariff`n']
capture noisily mat se_tariff`n' = nullmat(se_tariff`n')\se_lntariff`n'
...
in the above code, n is country pair id( n = 1, 2 , 3...). I want to save the coefficients of tariff variable(lntariff) and trade policy dummy variables(intcounp). however, in some country pairs, the tariff is all zero across my sample time, which would result to PPML drop the tariff variable(lntariff) or sometimes, this trade policy is not used in certain country pairs, which lead to trade policy dummy variable(intcounp) be zero, then again, PPML would drop this variable.
I'm wordering if there is any way to still store the coefficients of tariff variable (lntariff) and trade policy variable( intcounp) as empty cell even when they are all zero and PPML drop them.
ultimately, I want to achieve something like this:
countrypair is the country pair id variable, coef_lntariff is the coefficient of lntariff, se is the standard error...
each coefficient is corresponding to the country pair id.
Comment