Dear all,
I have a problem with a command and have not been able to solve it since I'm not a stata expert and new in the stata world. I was originally intending to use the PPML command to run a regression, including trade flows of Iran as my dependent variable, and some other variable as the regressors. I wanted to use three fixed effects, time dummies (year_*) as well as importer and exporter dummies (exp, imp), the reason why the PPML command did not work very well. Instead of that, I used the poi2hdfe command and it worked perfect:
Now, I am intending to predict the potential trade of Iran, clustered by each trade partner. I know there might be a command or subcommand for that, but I was not able to find it. So far I have this information:
Obviously I am missing the potential trade for each of countries trading with Iran. Does any body have a suggestion for me? I would appreciate any comments, replies. Thank you.
Homa
I have a problem with a command and have not been able to solve it since I'm not a stata expert and new in the stata world. I was originally intending to use the PPML command to run a regression, including trade flows of Iran as my dependent variable, and some other variable as the regressors. I wanted to use three fixed effects, time dummies (year_*) as well as importer and exporter dummies (exp, imp), the reason why the PPML command did not work very well. Instead of that, I used the poi2hdfe command and it worked perfect:
Code:
. poi2hdfe import1 loggdpimp loggdpexp logpimp logpexp logdist Dsanc Dlan Dbor year_*, id1(exp) id2(imp) Dropping exp groups for which import1 is always zeros Total Number of observations used in the regression -> 9367 Starting Estimation of coefficients 1 dif is -> 263.87923 2 dif is -> .88462613 3 dif is -> .78570317 4 dif is -> .47922415 5 dif is -> .22449422 6 dif is -> .09474546 7 dif is -> .05612353 8 dif is -> .03423796 9 dif is -> .01788093 10 dif is -> .00736692 11 dif is -> .00281278 12 dif is -> .0007891 13 dif is -> .00012874 14 dif is -> .00003796 15 dif is -> .00001659 16 dif is -> 4.337e-06 17 dif is -> 3.080e-07 18 dif is -> 1.542e-09 Coefficients converged after 18 reghdfe calls ******* Poisson Regression with Two High-Dimensional Fixed Effects ********** Number of obs = 9,367 ------------------------------------------------------------------------------ | Robust import1 | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- loggdpimp | 1.132046 .0885372 12.79 0.000 .9585161 1.305576 loggdpexp | 1.231915 .0705646 17.46 0.000 1.093611 1.370219 logpimp | .578808 .1490937 3.88 0.000 .2865898 .8710263 logpexp | .3734077 .2623947 1.42 0.155 -.1408765 .8876919 logdist | 0 (omitted) Dsanc | -.4244898 .0746442 -5.69 0.000 -.5707897 -.27819 Dlan | 0 (omitted) Dbor | 0 (omitted) year_1 | 1.59724 .265999 6.00 0.000 1.075891 2.118588 year_2 | 1.701557 .2586135 6.58 0.000 1.194684 2.20843 year_3 | 2.152632 .2441069 8.82 0.000 1.674192 2.631073 year_4 | 1.421192 .2058134 6.91 0.000 1.017805 1.824579 year_5 | 3.419411 .2805368 12.19 0.000 2.869569 3.969253 year_6 | 2.893661 .262118 11.04 0.000 2.379919 3.407403 year_7 | 2.405252 .2452033 9.81 0.000 1.924662 2.885841 year_8 | 1.846082 .2246121 8.22 0.000 1.40585 2.286313 year_9 | 1.710722 .2149643 7.96 0.000 1.289399 2.132044 year_10 | 1.730028 .2098566 8.24 0.000 1.318717 2.14134 year_11 | 1.70484 .2138328 7.97 0.000 1.285735 2.123944 year_12 | 1.434204 .2211158 6.49 0.000 1.000825 1.867583 year_13 | 1.809136 .2048561 8.83 0.000 1.407626 2.210647 year_14 | 1.73383 .1990534 8.71 0.000 1.343692 2.123967 year_15 | 1.728628 .1991251 8.68 0.000 1.33835 2.118906 year_16 | 1.608781 .1768353 9.10 0.000 1.26219 1.955371 year_17 | 1.428643 .1627806 8.78 0.000 1.109599 1.747687 year_18 | 1.261635 .149493 8.44 0.000 .9686343 1.554636 year_19 | 1.122973 .1241564 9.04 0.000 .8796311 1.366315 year_20 | .8207016 .1059854 7.74 0.000 .6129739 1.028429 year_21 | .7202783 .1085713 6.63 0.000 .5074824 .9330742 year_22 | .6247063 .0959396 6.51 0.000 .4366681 .8127445 year_23 | .4285563 .0886198 4.84 0.000 .2548647 .6022478 year_24 | .1697519 .081832 2.07 0.038 .0093643 .3301396 year_25 | -.0448062 .0988734 -0.45 0.650 -.2385945 .148982 year_26 | 0 (omitted) year_27 | .1756412 .0947305 1.85 0.064 -.0100273 .3613097 year_28 | .062862 .1126554 0.56 0.577 -.1579385 .2836625 year_29 | -.0120616 .1212996 -0.10 0.921 -.2498043 .2256812 ------------------------------------------------------------------------------
Code:
predict importhat, xb . generate exp_importhat = exp(importhat) . summarize import1 importhat exp_importhat Variable | Obs Mean Std. Dev. Min Max -------------+--------------------------------------------------------- import1 | 9,512 179.5432 1120.309 0 30332.97 importhat | 9,512 76.31283 3.932427 31.66138 86.08951 exp_import~t | 9,512 1.64e+35 1.15e+36 5.63e+13 2.44e+37
Homa
Comment