Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Clyde Schechter ,

    I want to express my sincere appreciation for your dedicated efforts and thorough discussion of the queries. I must extend my apologies for not maintaining the same level of communication as you have, owing to network issues on my end over the past couple of days.

    Regarding your inquiries, the panel variable in my dataset is a unique combination of importer-exporter-year, serving as the distinctive identifier for the dataset. Additionally, the dataset spans from 1995 to 2022. It's worth noting that the example in #10 featuring only a single year was a result of a sorting pattern.

    After reorganizing the dataset with a different pattern, I am sharing the updated example below:

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input float(pan_var year) str40(iso3_o iso3_d) double tradeflow_imf_d int dis_depth float(ln_pop_o ln_pop_d ln_gdp_d ln_gdp_o) byte(heg_o heg_d) double(pop_o pop_d gdp_o gdp_d) byte(wto_o wto_d eu_o eu_d rta_coverage rta_type landlocked_o landlocked_d)
       42 1995 "ARG" "ARE"              18000 0 10.458325  7.760597 18.001274 19.560337 0 0     34833.16796875 2346.304931640625    312569216        65743667.2 1 0 0 0 0 6 . .
     2925 1996 "ARG" "ARE"              26000 0  10.47062  7.812301 18.113764 19.613605 0 0      35264.0703125  2470.81005859375    329671168      73571237.888 1 1 0 0 0 6 . .
     5877 1997 "ARG" "ARE"              30000 0 10.482648   7.86672 18.182919 19.686945 0 0     35690.77734375 2608.992919921875    354757536      78839005.184 1 1 0 0 0 6 . .
     8829 1998 "ARG" "ARE"              25000 0 10.494307  7.920628  18.14195 19.707525 0 0     36109.33984375    2753.498046875    362133824       75674337.28 1 1 0 0 0 6 . .
    11781 1999 "ARG" "ARE"      90027.1796875 0 10.505466  7.970273 18.251617 19.654547 0 0     36514.55859375  2893.64794921875    343448288      84445478.912 1 1 0 0 0 6 . .
    14913 2000 "ARG" "ARE"               3940 0  10.51605  8.015113  18.46314 19.656944 0 0      36903.0703125  3026.35205078125    344272896     104337375.232 1 1 0 0 0 6 . .
    18158 2001 "ARG" "ARE"              48700 0 10.526034   8.04946  18.45326  19.60084 0 0       37273.359375  3132.10400390625    325488352      103311646.72 1 1 0 0 0 6 . .
    21480 2002 "ARG" "ARE"              29000 0 10.535492  8.078368 18.514318 18.632622 0 0     37627.54296875 3223.968994140625    123607464     109816201.216 1 1 0 0 0 6 . .
    24803 2003 "ARG" "ARE"              57500 0 10.544562  8.122447 18.638582 18.871685 0 0     37970.41015625     3369.25390625    156988736     124346359.808 1 1 0 0 0 6 . .
    28205 2004 "ARG" "ARE"        87500.90625 0 10.553434  8.204852 18.811535 19.026611 0 0        38308.78125 3658.657958984375    183295712     147824377.856 1 1 0 0 0 6 . .
    31607 2005 "ARG" "ARE"        294088.5625 0 10.562246  8.330594 19.011889  19.22227 0 0     38647.85546875      4148.8828125    222907568     180617019.392 1 1 0 0 0 6 . .
    35009 2006 "ARG" "ARE"       174206.40625 0 10.571033  8.492006 19.218664  19.39331 0 0       38988.921875  4875.63916015625    264489696      222105927.68 1 1 0 0 0 6 . .
    38411 2007 "ARG" "ARE"      178138.828125 0 10.579778  8.665155 19.368145  19.61388 0 0     39331.35546875  5797.34716796875    329761504     257916141.568 1 1 0 0 0 6 . .
    41814 2008 "ARG" "ARE"          323756.75 0 10.588504  8.824477  19.56959  19.82187 0 0     39676.08203125    6798.634765625    406003744     315474640.896 1 1 0 0 0 6 . .
    45298 2009 "ARG" "ARE"       261598.96875 0 10.597225  8.951352  19.35106 19.751717 0 0       40023.640625  7718.31884765625    378496224     253547462.656 1 1 0 0 0 6 . .
    48782 2010 "ARG" "ARE"         238509.625 0 10.605947  9.040919 19.471674 19.952597 0 0      40374.2265625    8441.537109375    462703776     286049304.576 1 1 0 0 0 6 . .
    52266 2011 "ARG" "ARE"        334428.6875 0  10.61469  9.096622 19.666143  20.13938 0 0     40728.73828125    8925.095703125    557727296     347454046.208 1 1 0 0 0 6 . .
    55752 2012 "ARG" "ARE"        436736.0625 0 10.623446  9.127573  19.73525  20.21768 0 0     41086.92578125   9205.6513671875    603153024     372313980.928 1 1 0 0 0 6 . .
    59407 2013 "ARG" "ARE"         372319.375 0 10.632153  9.142717  19.81281  20.22879 0 0     41446.24609375     9346.12890625    609888960     402340118.528 1 1 0 0 0 6 . .
    63062 2014 "ARG" "ARE"           262203.5 0 10.668526 9.1128235  19.81494  20.08142 0 0       42981.515625      9070.8671875    526319680     403197689.856 1 1 0 0 0 6 . .
    66717 2015 "ARG" "ARE"         193375.375 0 10.678624  9.121979   19.6959  20.18663 0 0       43417.765625   9154.3017578125    584711488     357949210.624 1 1 0 0 0 6 . .
    70372 2016 "ARG" "ARE"       177065.15625 0 10.688472  9.134497  19.66985 20.117884 0 0      43847.4296875   9269.6123046875    545866176       348743270.4 1 1 0 0 0 6 . .
    74027 2017 "ARG" "ARE"        265546.3125 0 10.692963    9.1577 19.770325  20.28263 0 0         44044.8125       9487.203125    643628672     385605506.855 1 1 0 0 0 6 . .
    77682 2018 "ARG" "ARE"        261049.9375 0  10.70312  9.172738 19.861025 20.064764 0 0     44494.50390625    9630.958984375    517626688     422215043.585 1 1 0 0 0 6 . .
    81337 2019 "ARG" "ARE"      155152.046875 0 10.713055  9.187126  19.85848 19.914585 0 0     44938.71484375    9770.529296875    445445184     421142267.938 1 1 0 0 0 6 . .
    84993 2020 "ARG" "ARE"              91.54 0  17.63051 16.044157  26.57969  26.67791 0 0           45376764           9287289 385540227072 349473015336.9394 1 0 0 0 . . . .
    88694 2021 "ARG" "ARE"            337.557 0 17.639986 16.052505 26.751596 26.911997 0 0           45808748           9365145 487227326464 415021590683.0062 1 0 0 0 . . . .
    92395 2022 "ARG" "ARE"            863.546 0 17.649244 16.060587  26.95283 27.173374 0 0           46234832           9441129 632770265088 507534921715.4527 1 0 0 0 . . . .
       83 1995 "ATG" "ARE"                  0 0  4.224627  7.760597 18.001274 13.110665 0 0   68.3489990234375 2346.304931640625  494185.1875        65743667.2 1 0 0 0 0 6 . .
     2966 1996 "ATG" "ARE"                  0 0 4.2519894  7.812301 18.113764  13.20131 0 0  70.24500274658203  2470.81005859375  541074.0625      73571237.888 1 1 0 0 0 6 . .
     5918 1997 "ATG" "ARE"                  0 0 4.2798834   7.86672 18.182919 13.270528 0 0  72.23200225830078 2608.992919921875  579851.8125      78839005.184 1 1 0 0 0 6 . .
     8870 1998 "ATG" "ARE"                  0 0  4.306845  7.920628  18.14195 13.337535 0 0  74.20600128173828    2753.498046875  620037.0625       75674337.28 1 1 0 0 0 6 . .
    11822 1999 "ATG" "ARE"                  0 0 4.3312726  7.970273 18.251617 13.387572 0 0  76.04100036621094  2893.64794921875  651851.8125      84445478.912 1 1 0 0 0 6 . .
    14954 2000 "ATG" "ARE"                  0 0 4.3521857  8.015113  18.46314 13.571958 0 0  77.64800262451172  3026.35205078125  783837.8125     104337375.232 1 1 0 0 0 6 . .
    18199 2001 "ATG" "ARE"                  0 0 4.3690934   8.04946  18.45326 13.559024 0 0  78.97200012207031  3132.10400390625  773765.1875      103311646.72 1 1 0 0 0 6 . .
    21521 2002 "ATG" "ARE"                  0 0 4.3824015  8.078368 18.514318 13.595524 0 0  80.02999877929688 3223.968994140625   802529.375     109816201.216 1 1 0 0 0 6 . .
    24844 2003 "ATG" "ARE"                  0 0 4.3932633  8.122447 18.638582 13.641152 0 0  80.90399932861328     3369.25390625   839996.375     124346359.808 1 1 0 0 0 6 . .
    28246 2004 "ATG" "ARE" 30.584999084472656 0 4.4032745  8.204852 18.811535 13.708322 0 0  81.71800231933594 3658.657958984375  898356.1875     147824377.856 1 1 0 0 0 6 . .
    31648 2005 "ATG" "ARE" 1.3079999685287476 0 4.4135857  8.330594 19.011889 13.812881 0 0  82.56500244140625      4148.8828125  997374.0625     180617019.392 1 1 0 0 0 6 . .
    35050 2006 "ATG" "ARE"                  0 0 4.4244514  8.492006 19.218664  13.94227 0 0  83.46700286865234  4875.63916015625    1135143.5      222105927.68 1 1 0 0 0 6 . .
    38452 2007 "ATG" "ARE" 240.81300354003906 0  4.435532  8.665155 19.368145 14.069574 0 0  84.39700317382813  5797.34716796875   1289254.25     257916141.568 1 1 0 0 0 6 . .
    41855 2008 "ATG" "ARE" 12.902000427246094 0 4.4467487  8.824477  19.56959  14.11365 0 0   85.3489990234375    6798.634765625  1347349.875     315474640.896 1 1 0 0 0 6 . .
    45339 2009 "ATG" "ARE"   9.51200008392334 0 4.4578295  8.951352  19.35106  14.00316 0 0  86.30000305175781  7718.31884765625  1206410.375     253547462.656 1 1 0 0 0 6 . .
    48823 2010 "ATG" "ARE" 3.4030001163482666 0 4.4685826  9.040919 19.471674 13.942618 0 0  87.23300170898438    8441.537109375  1135539.125     286049304.576 1 1 0 0 0 6 . .
    52307 2011 "ATG" "ARE"  47.72600173950195 0 4.4790626  9.096622 19.666143 13.937656 0 0   88.1520004272461    8925.095703125  1129918.375     347454046.208 1 1 0 0 0 6 . .
    55793 2012 "ATG" "ARE"  14.24899959564209 0 4.4894114  9.127573  19.73525 14.001752 0 0  89.06900024414063   9205.6513671875  1204713.125     372313980.928 1 1 0 0 0 6 . .
    59448 2013 "ATG" "ARE"  185.7550048828125 0  4.499643  9.142717  19.81281 13.998322 0 0  89.98500061035156     9346.12890625    1200587.5     402340118.528 1 1 0 0 0 6 . .
    63103 2014 "ATG" "ARE"  582.3510131835938 0 4.5938563 9.1128235  19.81494  14.05793 0 0             98.875      9070.8671875  1274330.375     403197689.856 1 1 0 0 0 6 . .
    66758 2015 "ATG" "ARE"            .691747 0 4.6043997  9.121979   19.6959  14.11979 0 0   99.9229965209961   9154.3017578125      1355646     357949210.624 1 1 0 0 0 6 . .
    70413 2016 "ATG" "ARE"  33.01599884033203 0  4.614754  9.134497  19.66985 14.186495 0 0 100.96299743652344   9269.6123046875   1449160.25       348743270.4 1 1 0 0 0 6 . .
    74068 2017 "ATG" "ARE" 271.23699951171875 0  4.558351    9.1577 19.770325 14.199396 0 0   95.4260025024414       9487.203125   1467977.75     385605506.855 1 1 0 0 0 6 . .
    77723 2018 "ATG" "ARE" 17.582000732421875 0 4.5673227  9.172738 19.861025 14.288854 0 0  96.28600311279297    9630.958984375  1605351.875     422215043.585 1 1 0 0 0 6 . .
    81378 2019 "ATG" "ARE"            .632782 0  4.575927  9.187126  19.85848  14.32351 0 0  97.11799621582031    9770.529296875      1661963     421142267.938 1 1 0 0 0 6 . .
    85034 2020 "ATG" "ARE"            .442552 0 11.436735 16.044157  26.57969  21.03828 0 0              92664           9287289   1370281472 349473015336.9394 1 0 0 0 . . . .
    88735 2021 "ATG" "ARE"            .801864 0 11.442707 16.052505 26.751596 21.109293 0 0              93219           9365145   1471125888 415021590683.0062 1 0 0 0 . . . .
    92436 2022 "ATG" "ARE"           1.071888 0 11.448525 16.060587  26.95283  21.28722 0 0              93763           9441129   1757603712 507534921715.4527 1 0 0 0 . . . .
      222 1995 "BHR" "ARE"             111000 0  6.334575  7.760597 18.001274 22.489616 0 0    563.72998046875 2346.304931640625   5849467904        65743667.2 1 0 0 0 1 1 . .
     3142 1996 "BHR" "ARE"             123000 0  6.362505  7.812301 18.113764 15.624104 0 0   579.697021484375  2470.81005859375      6101862      73571237.888 1 1 0 0 1 1 . .
     6094 1997 "BHR" "ARE"              82000 0  6.392587   7.86672 18.182919  15.66384 0 0  597.4000244140625 2608.992919921875    6349202.5      78839005.184 1 1 0 0 1 1 . .
     9046 1998 "BHR" "ARE"             112000 0  6.425739  7.920628  18.14195 15.637466 0 0  617.5369873046875    2753.498046875      6183941       75674337.28 1 1 0 0 1 1 . .
    12006 1999 "BHR" "ARE"             108976 0  6.462894  7.970273 18.251617 15.705785 0 0  640.9130249023438  2893.64794921875    6621186.5      84445478.912 1 1 0 0 1 1 . .
    15146 2000 "BHR" "ARE"             121800 0  6.504646  8.015113  18.46314 16.019728 0 0   668.239013671875  3026.35205078125      9063148     104337375.232 1 1 0 0 1 1 . .
    18395 2001 "BHR" "ARE"             152100 0  6.549292   8.04946  18.45326 16.010115 0 0     698.7490234375  3132.10400390625      8976446      103311646.72 1 1 0 0 1 1 . .
    21717 2002 "BHR" "ARE"             161700 0  6.596519  8.078368 18.514318 16.080645 0 0      732.541015625 3223.968994140625      9632411     109816201.216 1 1 0 0 1 1 . .
    25044 2003 "BHR" "ARE"             246700 0   6.64906  8.122447 18.638582 16.220211 0 0  772.0579833984375     3369.25390625     11075117     124346359.808 1 1 0 0 1 1 . .
    28446 2004 "BHR" "ARE"         297287.875 0   6.70992  8.204852 18.811535 16.391972 0 0  820.5050048828125 3658.657958984375     13150516     147824377.856 1 1 0 0 1 1 . .
    31848 2005 "BHR" "ARE"         288758.125 0  6.779392  8.330594 19.011889  16.58617 0 0  879.5339965820313      4148.8828125     15969151     180617019.392 1 1 0 0 1 1 . .
    35250 2006 "BHR" "ARE"        576179.3125 0  6.857462  8.492006 19.218664 16.733582 0 0  950.9509887695313  4875.63916015625     18505546      222105927.68 1 1 0 0 1 1 . .
    38652 2007 "BHR" "ARE"             415001 0  6.939596  8.665155 19.368145 16.894232 0 0   1032.35302734375  5797.34716796875     21730578     257916141.568 1 1 0 0 1 1 . .
    42059 2008 "BHR" "ARE"        668324.8125 0   7.01754  8.824477  19.56959 17.062435 0 0 1116.0379638671875    6798.634765625     25711152     315474640.896 1 1 0 0 1 1 . .
    45543 2009 "BHR" "ARE"        624410.3125 0  7.083001  8.951352  19.35106 16.948326 0 0 1191.5389404296875  7718.31884765625     22938462     253547462.656 1 1 0 0 1 1 . .
    49027 2010 "BHR" "ARE"        618739.5625 0  7.132109  9.040919 19.471674 17.062529 0 0  1251.512939453125    8441.537109375     25713546     286049304.576 1 1 0 0 1 1 . .
    52511 2011 "BHR" "ARE"         856088.375 0  7.164538  9.096622 19.666143 17.184336 0 0 1292.7640380859375    8925.095703125     29044378     347454046.208 1 1 0 0 1 1 . .
    56005 2012 "BHR" "ARE"        844741.4375 0   7.18374  9.127573  19.73525 17.241621 0 0 1317.8270263671875   9205.6513671875     30756790     372313980.928 1 1 0 0 1 1 . .
    59660 2013 "BHR" "ARE"          651082.75 0  7.194565  9.142717  19.81281 17.308683 0 0 1332.1710205078125     9346.12890625     32890110     402340118.528 1 1 0 0 3 2 . .
    63315 2014 "BHR" "ARE"         762443.375 0  7.197732 9.1128235  19.81494 17.323698 0 0   1336.39697265625      9070.8671875     33387712     403197689.856 1 1 0 0 3 2 . .
    66970 2015 "BHR" "ARE"             717418 0  7.223919  9.121979   19.6959  17.25355 0 0   1371.85498046875   9154.3017578125     31125850     357949210.624 1 1 0 0 3 2 . .
    70625 2016 "BHR" "ARE"        906350.9375 0  7.262047  9.134497  19.66985 17.276815 0 0 1425.1710205078125   9269.6123046875     31858510       348743270.4 1 1 0 0 3 2 . .
    74280 2017 "BHR" "ARE"            2305988 0  7.309262    9.1577 19.770325 17.384304 0 0  1494.073974609375       9487.203125     35473776     385605506.855 1 1 0 0 3 2 . .
    77935 2018 "BHR" "ARE"          3272899.5 0  7.358473  9.172738 19.861025  17.44391 0 0   1569.43896484375    9630.958984375     37652500     422215043.585 1 1 0 0 3 2 . .
    81590 2019 "BHR" "ARE"          2271516.5 0  7.403166  9.187126  19.85848  17.46809 0 0 1641.1719970703125    9770.529296875     38574068     421142267.938 1 1 0 0 3 2 . .
    85251 2020 "BHR" "ARE"         802.987993 0  14.20584 16.044157  26.57969  24.27068 0 0            1477469           9287289  34723356672 349473015336.9394 1 0 0 0 . . . .
    88952 2021 "BHR" "ARE"        1307.731112 0  14.19618 16.052505 26.751596 24.383453 0 0            1463265           9365145  38868664320 415021590683.0062 1 0 0 0 . . . .
    92653 2022 "BHR" "ARE"        1285.691009 0  14.20229 16.060587  26.95283   24.5163 0 0            1472233           9441129  44390821888 507534921715.4527 1 0 0 0 . . . .
      263 1995 "BRA" "ARE"             107000 0 11.994678  7.760597 18.001274  20.46054 0 0      161890.828125 2346.304931640625    768951296        65743667.2 1 0 0 0 0 6 . .
     3183 1996 "BRA" "ARE"             132000 0 12.010012  7.812301 18.113764 20.548534 0 0      164392.421875  2470.81005859375    839682624      73571237.888 1 1 0 0 0 6 . .
     6135 1997 "BRA" "ARE"             120000 0 12.025303   7.86672 18.182919  20.58538 0 0       166925.46875 2608.992919921875    871200320      78839005.184 1 1 0 0 0 6 . .
     9087 1998 "BRA" "ARE"             119000 0 12.040445  7.920628  18.14195  20.55346 0 0       169472.34375    2753.498046875    843827392       75674337.28 1 1 0 0 0 6 . .
    12047 1999 "BRA" "ARE"      176343.203125 0 12.055286  7.970273 18.251617   20.1903 0 0      172006.359375  2893.64794921875    586862656      84445478.912 1 1 0 0 0 6 . .
    15187 2000 "BRA" "ARE"             130800 0 12.069708  8.015113  18.46314   20.2843 0 0      174504.890625  3026.35205078125    644701824     104337375.232 1 1 0 0 0 6 . .
    18436 2001 "BRA" "ARE"             180700 0 12.083725   8.04946  18.45326  20.13192 0 0      176968.203125  3132.10400390625    553582208      103311646.72 1 1 0 0 0 6 . .
    21758 2002 "BRA" "ARE"             193100 0  12.09734  8.078368 18.514318 20.038527 0 0      179393.765625 3223.968994140625    504221248     109816201.216 1 1 0 0 0 6 . .
    25085 2003 "BRA" "ARE"             404400 0 12.110404  8.122447 18.638582  20.12991 0 0        181752.9375     3369.25390625    552469248     124346359.808 1 1 0 0 0 6 . .
    28487 2004 "BRA" "ARE"        643661.5625 0 12.122746  8.204852 18.811535  20.31343 0 0       184010.28125 3658.657958984375    663760320     147824377.856 1 1 0 0 0 6 . .
    31889 2005 "BRA" "ARE"           816267.5 0 12.134267  8.330594 19.011889 20.597914 0 0       186142.40625      4148.8828125    882185728     180617019.392 1 1 0 0 0 6 . .
    35291 2006 "BRA" "ARE"        1060084.375 0 12.144912  8.492006 19.218664  20.80845 0 0        188134.3125  4875.63916015625   1088916864      222105927.68 1 1 0 0 0 6 . .
    38693 2007 "BRA" "ARE"        1289653.125 0 12.154763  8.665155 19.368145 21.035755 0 0      189996.984375  5797.34716796875   1366824064     257916141.568 1 1 0 0 0 6 . .
    42100 2008 "BRA" "ARE"          1169656.5 0  12.16403  8.824477  19.56959 21.226166 0 0        191765.5625    6798.634765625   1653508480     315474640.896 1 1 0 0 0 6 . .
    45584 2009 "BRA" "ARE"        1021147.875 0 12.172986  8.951352  19.35106  21.20581 0 0      193490.921875  7718.31884765625   1620188032     253547462.656 1 1 0 0 0 6 . .
    49068 2010 "BRA" "ARE"         1217518.75 0 12.181832  9.040919 19.471674 21.485504 0 0       195210.15625    8441.537109375   2143067776     286049304.576 1 1 0 0 0 6 . .
    end
    i hope now this makes some sense and i haven't missed any important information.
    thank you once gain for your time and effort.

    Comment


    • #17
      The problem is the way you created pan_var. By making it the combination of importer, exporter and year, you have reduced each panel to a single observation! Therefore all lagged values are missing, because in any given "panel" there is only a single year's worth of data. What you need to do is set the panel variable to combinations of only importer and exporter. Also, I would do this before -mi set-. So I see it going something like this:
      Code:
      egen pan_var = group(iso*)
      xtset pan_var year
      foreach v of varlist tradeflow_imf_d-landlocked_d {
          gen lag_`v' = L1.`v'
      }
      After that is done, you can go ahead and -mi set- your data. And I would also -mi xtset pan_var year- once you have your imputed data sets.



      Comment


      • #18
        Thank you, Clyde Schechter.
        #17 worked, the problem was hidden in "pan_var".
        It was indeed a meaningful and helpful thread.
        Once again, I appreciate your efforts and time.
        Good luck!

        Comment

        Working...
        X