Announcement

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

  • #16
    I did as you said and ran the code without interruption, this time I got an error saying - EXP_TIME_FE_1-EXP_TIME_FE_5 invalid name.

    Here is a snippet of the dataset. I omitted quite a number of variables due to the limit;

    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input str3 exporter str8 importer float year byte(EXP_TIME_FE_1 EXP_TIME_FE_2 EXP_TIME_FE_3 EXP_TIME_FE_4 EXP_TIME_FE_5 IMP_TIME_FE_1 IMP_TIME_FE_2 IMP_TIME_FE_3 IMP_TIME_FE_4 IMP_TIME_FE_5 IMP_TIME_FE_6 IMP_TIME_FE_7)
    "CAN" "USA" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "FRA" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "CYM" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "FRA" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "JPN" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "SGP" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "ZMB" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "DOM" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "FRA" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "PAN" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "MAR" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "TWN" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "KNA" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "USA" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "COL" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "USA" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "CHN" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "USA" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "JPN" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "PER" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "BRB" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "GUY" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "EST" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "PER" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "HKG" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "CRI" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "SLE" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "LBN" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "TTO" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "CYM" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "ESP" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "ARE" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "NLD" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "GTM" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "NGA" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "USA" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "POL" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "FRA" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "VNM" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "BRB" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "BRB" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "ATG" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "VEN" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "NPL" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "IRN" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "GBR" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "VNM" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "GRD" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "BRB" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "MEX" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "CHE" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "GTM" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "BRB" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "MEX" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "GRC" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "KOR" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "FRA" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "DEU" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "BRB" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "PHL" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "USA" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "SLV" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "JAM" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "SPM" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "JPN" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "SPM" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "CHN" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "CUB" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "DEU" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "DEU" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "BFA" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "DEU" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "VCT" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "ARE" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "PHL" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "JPN" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "URY" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "POL" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "ESP" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "EGY" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "TGO" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "CHN" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "HKG" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "AUS" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "MEX" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "HKG" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "AUS" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "SGP" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "IND" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "USA" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "SAU" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "PHL" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "USA" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "NLD" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "NZL" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "TTO" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "DEU" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "CHN" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "KWT" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    "CAN" "DOM" 2018 1 0 0 0 0 0 0 0 0 0 0 0
    end

    Comment


    • #17
      I am unable to troubleshoot your code directly because the data example provided does not contain variables that are referred to such as it or jt.

      Just visually exploring the code, I am struck by the oddness of the -ppml- command. You have put "EXP_TIME_FE_1-EXP_TIME_FE_`it'" "IMP_TIME_FE_1-IMP_TIME_FE_`jt_ref'" in quotes. I am not a -ppml- user, and I don't know how it works. But I understand it is an estimation command. Having these string expressions where I would normally expect to see lists of regressor variables raises my suspicions that you are doing it wrong. Normally lists of regressor variables will not be wrapped in quotation marks. For example, contrast:
      Code:
      . sysuse auto, clear
      (1978 automobile data)
      
      . regress price mpg-headroom
      
            Source |       SS           df       MS      Number of obs   =        69
      -------------+----------------------------------   F(3, 65)        =      7.51
             Model |   148497605         3  49499201.8   Prob > F        =    0.0002
          Residual |   428299354        65  6589220.82   R-squared       =    0.2575
      -------------+----------------------------------   Adj R-squared   =    0.2232
             Total |   576796959        68  8482308.22   Root MSE        =    2566.9
      
      ------------------------------------------------------------------------------
             price | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
      -------------+----------------------------------------------------------------
               mpg |  -289.3462   62.53921    -4.63   0.000    -414.2456   -164.4467
             rep78 |   670.8971   343.5213     1.95   0.055    -15.16242    1356.957
          headroom |  -300.0293   398.0516    -0.75   0.454    -1094.993    494.9346
             _cons |   10921.33   2153.003     5.07   0.000     6621.487    15221.17
      ------------------------------------------------------------------------------
      
      . regress price "mpg-headroom"
      "mpg-headroom invalid name
      r(198);
      The fact that this second command produces the analogous error message to what you are getting from -ppml- suggests to me that -ppml-, like any normal Stata estimation command, does not want its variable lists to be in quotes. Try removing the quotes from the -ppml- command and see if that works.

      If that doesn't fix the problem, post back with a data example that can run the code and produce the error message and I will install -ppml- and try to troubleshoot.

      Comment


      • #18
        Thank you so much! I removed the quotes and I still got the same error message. Here is a data example;

        Code:
        * Example generated by -dataex-. For more info, type help dataex
        clear
        input str3 exporter str8 importer float value long hs06 float(i j it jt) byte(EXP_TIME_FE_1 EXP_TIME_FE_2 EXP_TIME_FE_3 EXP_TIME_FE_4 EXP_TIME_FE_5 IMP_TIME_FE_1 IMP_TIME_FE_2 IMP_TIME_FE_3) float(contig comlang colties) double dist float fta
        "CAN" "USA"    19815 230320 1 205 1 946 1 0 0 0 0 0 0 0 1 1 0 548.3946 1
        "CAN" "FRA"      200 200979 1  70 1 316 1 0 0 0 0 0 0 0 0 0 1 6004.645 1
        "CAN" "CYM"     2491 200989 1  51 1 233 1 0 0 0 0 0 0 0 0 1 0 2716.584 0
        "CAN" "FRA"        0  30333 1  70 1 316 1 0 0 0 0 0 0 0 0 0 1 6004.645 1
        "CAN" "JPN"  1415541 121410 1 103 1 470 1 0 0 0 0 0 0 0 0 0 0 10358.49 1
        "CAN" "SGP"        0 350290 1 171 1 791 1 0 0 0 0 0 0 0 0 1 0 15022.44 1
        "CAN" "ZMB"        0 210690 1 215 1 991 1 0 0 0 0 0 0 0 0 1 0 12609.73 0
        "CAN" "DOM"        0 120590 1  58 1 267 1 0 0 0 0 0 0 0 0 0 0 2939.963 0
        "CAN" "FRA"     4169 220299 1  70 1 316 1 0 0 0 0 0 0 0 0 0 1 6004.645 1
        "CAN" "PAN"        0  20319 1 154 1 712 1 0 0 0 0 0 0 0 0 0 0   3862.1 1
        "CAN" "MAR"        0  51110 1 124 1 570 1 0 0 0 0 0 0 0 0 0 0 6177.698 0
        "CAN" "TWN"   102344  70200 1 199 1 916 1 0 0 0 0 0 0 0 0 0 0 12090.98 0
        "CAN" "KNA"    14750  30559 1 109 1 498 1 0 0 0 0 0 0 0 0 1 0 3327.077 0
        "CAN" "USA"  1895860 170240 1 205 1 946 1 0 0 0 0 0 0 0 1 1 0 548.3946 1
        "CAN" "COL"   148878 180620 1  44 1 198 1 0 0 0 0 0 0 0 0 0 0 4363.174 1
        "CAN" "USA"    68858 100410 1 205 1 946 1 0 0 0 0 0 0 0 1 1 0 548.3946 1
        "CAN" "CHN"        0 190490 1  39 1 173 1 0 0 0 0 0 0 0 0 0 0 10598.32 0
        "CAN" "USA"   427614  40390 1 205 1 946 1 0 0 0 0 0 0 0 1 1 0 548.3946 1
        "CAN" "JPN"        0 330210 1 103 1 470 1 0 0 0 0 0 0 0 0 0 0 10358.49 1
        "CAN" "PER"        0  40410 1 156 1 720 1 0 0 0 0 0 0 0 0 0 0 6209.441 1
        "CAN" "BRB"     2330 110412 1  32 1 146 1 0 0 0 0 0 0 0 0 1 0 3889.655 0
        "CAN" "GUY"        0 151419 1  85 1 388 1 0 0 0 0 0 0 0 0 1 0 4597.552 0
        "CAN" "EST"        0  51110 1  65 1 295 1 0 0 0 0 0 0 0 0 0 0 6645.816 1
        "CAN" "PER"        0 200990 1 156 1 720 1 0 0 0 0 0 0 0 0 0 0 6209.441 1
        "CAN" "HKG"        0  30811 1  86 1 393 1 0 0 0 0 0 0 0 0 1 0 12568.15 0
        "CAN" "CRI"    15229 100830 1  47 1 213 1 0 0 0 0 0 0 0 0 0 0 3774.394 1
        "CAN" "SLE"    62414 220710 1 173 1 798 1 0 0 0 0 0 0 0 0 1 0 7448.309 0
        "CAN" "LBN"        0 220710 1 113 1 518 1 0 0 0 0 0 0 0 0 0 0 9173.474 0
        "CAN" "TTO"    32169  20726 1 196 1 901 1 0 0 0 0 0 0 0 0 1 0 4058.435 0
        "CAN" "CYM"        0 200971 1  51 1 233 1 0 0 0 0 0 0 0 0 1 0 2716.584 0
        "CAN" "ESP"        0 330112 1  64 1 290 1 0 0 0 0 0 0 0 0 0 0 6040.498 1
        "CAN" "ARE"        0 200599 1   7 1  27 1 0 0 0 0 0 0 0 0 0 0  11105.9 0
        "CAN" "NLD"   488272 190532 1 147 1 680 1 0 0 0 0 0 0 0 0 0 0 5988.239 1
        "CAN" "GTM"        0 210320 1  83 1 378 1 0 0 0 0 0 0 0 0 0 0 3398.818 0
        "CAN" "NGA"        0 210500 1 144 1 669 1 0 0 0 0 0 0 0 0 1 0  8946.49 0
        "CAN" "USA"   347142 220110 1 205 1 946 1 0 0 0 0 0 0 0 1 1 0 548.3946 1
        "CAN" "POL"        0 430180 1 159 1 735 1 0 0 0 0 0 0 0 0 0 0 6925.886 1
        "CAN" "FRA"       36 190190 1  70 1 316 1 0 0 0 0 0 0 0 0 0 1 6004.645 1
        "CAN" "VNM"   159268  20329 1 210 1 971 1 0 0 0 0 0 0 0 0 0 0 12816.55 1
        "CAN" "BRB"      213 190219 1  32 1 146 1 0 0 0 0 0 0 0 0 1 0 3889.655 0
        "CAN" "BRB"        0 210390 1  32 1 146 1 0 0 0 0 0 0 0 0 1 0 3889.655 0
        "CAN" "ATG"        0  71320 1  13 1  51 1 0 0 0 0 0 0 0 0 1 0 3382.002 0
        "CAN" "VEN"  9945001 100199 1 208 1 961 1 0 0 0 0 0 0 0 0 0 0 3871.308 0
        "CAN" "NPL"    14129  10512 1 149 1 690 1 0 0 0 0 0 0 0 0 0 0 11940.37 0
        "CAN" "IRN"        0 180690 1  96 1 435 1 0 0 0 0 0 0 0 0 0 0 9900.537 0
        "CAN" "GBR"    41202  80929 1  72 1 326 1 0 0 0 0 0 0 0 0 1 1 5715.747 0
        "CAN" "VNM"        0  70110 1 210 1 971 1 0 0 0 0 0 0 0 0 0 0 12816.55 1
        "CAN" "GRD"        0  20622 1  81 1 368 1 0 0 0 0 0 0 0 0 1 0  3901.79 0
        "CAN" "BRB"        0  60420 1  32 1 146 1 0 0 0 0 0 0 0 0 1 0 3889.655 0
        "CAN" "MEX"        0  80810 1 128 1 589 1 0 0 0 0 0 0 0 0 0 0  3267.29 1
        "CAN" "CHE"    39129  90300 1  37 1 163 1 0 0 0 0 0 0 0 0 0 0 6440.717 1
        "CAN" "GTM"        0  40210 1  83 1 378 1 0 0 0 0 0 0 0 0 0 0 3398.818 0
        "CAN" "BRB"        0 220190 1  32 1 146 1 0 0 0 0 0 0 0 0 1 0 3889.655 0
        "CAN" "MEX"        0  70110 1 128 1 589 1 0 0 0 0 0 0 0 0 0 0  3267.29 1
        "CAN" "GRC"        0 350400 1  80 1 363 1 0 0 0 0 0 0 0 0 0 0 8103.304 1
        "CAN" "KOR"        0  10310 1 110 1 503 1 0 0 0 0 0 0 0 0 0 0  10617.7 1
        "CAN" "FRA"   141196 110100 1  70 1 316 1 0 0 0 0 0 0 0 0 0 1 6004.645 1
        "CAN" "DEU"    23590  40711 1  54 1 248 1 0 0 0 0 0 0 0 0 0 0 6160.559 1
        "CAN" "BRB"     2216 200520 1  32 1 146 1 0 0 0 0 0 0 0 0 1 0 3889.655 0
        "CAN" "PHL"        0 410190 1 157 1 725 1 0 0 0 0 0 0 0 0 1 0 13226.18 0
        "CAN" "USA"    22840 180100 1 205 1 946 1 0 0 0 0 0 0 0 1 1 0 548.3946 1
        "CAN" "SLV"        0 200799 1 174 1 803 1 0 0 0 0 0 0 0 0 0 0 3465.451 0
        "CAN" "JAM"        0  20910 1 101 1 460 1 0 0 0 0 0 0 0 0 1 0 2868.783 0
        "CAN" "SPM"      783  21011 1 176 1 813 1 0 0 0 0 0 0 0 0 0 0 1845.482 0
        "CAN" "JPN" 16303176  20329 1 103 1 470 1 0 0 0 0 0 0 0 0 0 0 10358.49 1
        "CAN" "SPM"      117  71220 1 176 1 813 1 0 0 0 0 0 0 0 0 0 0 1845.482 0
        "CAN" "CHN"   445375  30499 1  39 1 173 1 0 0 0 0 0 0 0 0 0 0 10598.32 0
        "CAN" "CUB"        0 121221 1  48 1 218 1 0 0 0 0 0 0 0 0 0 0 2302.272 0
        "CAN" "DEU"        0  30363 1  54 1 248 1 0 0 0 0 0 0 0 0 0 0 6160.559 1
        "CAN" "DEU"  5024591 170220 1  54 1 248 1 0 0 0 0 0 0 0 0 0 0 6160.559 1
        "CAN" "BFA"        0 200580 1  21 1  91 1 0 0 0 0 0 0 0 0 0 0 8088.204 0
        "CAN" "DEU"        0 120799 1  54 1 248 1 0 0 0 0 0 0 0 0 0 0 6160.559 1
        "CAN" "VCT"   128199  30559 1 207 1 956 1 0 0 0 0 0 0 0 0 1 0 3806.961 0
        "CAN" "ARE"        0 120750 1   7 1  27 1 0 0 0 0 0 0 0 0 0 0  11105.9 0
        "CAN" "PHL"        0 200559 1 157 1 725 1 0 0 0 0 0 0 0 0 1 0 13226.18 0
        "CAN" "JPN"     1229 210120 1 103 1 470 1 0 0 0 0 0 0 0 0 0 0 10358.49 1
        "CAN" "URY"   134662  71340 1 204 1 941 1 0 0 0 0 0 0 0 0 0 0   9055.5 0
        "CAN" "POL"        0  10512 1 159 1 735 1 0 0 0 0 0 0 0 0 0 0 6925.886 1
        "CAN" "ESP"        0  30389 1  64 1 290 1 0 0 0 0 0 0 0 0 0 0 6040.498 1
        "CAN" "EGY"        0 230990 1  61 1 282 1 0 0 0 0 0 0 0 0 0 0 9217.863 0
        "CAN" "TGO"        0 190240 1 190 1 879 1 0 0 0 0 0 0 0 0 0 0 8797.691 0
        "CAN" "CHN"     2480  90121 1  39 1 173 1 0 0 0 0 0 0 0 0 0 0 10598.32 0
        "CAN" "HKG"        0  30489 1  86 1 393 1 0 0 0 0 0 0 0 0 1 0 12568.15 0
        "CAN" "AUS"        0 200897 1  14 1  56 1 0 0 0 0 0 0 0 0 1 0 15586.66 1
        "CAN" "MEX"        0  10619 1 128 1 589 1 0 0 0 0 0 0 0 0 0 0  3267.29 1
        "CAN" "HKG"   892416 120190 1  86 1 393 1 0 0 0 0 0 0 0 0 1 0 12568.15 0
        "CAN" "AUS"   215825  20322 1  14 1  56 1 0 0 0 0 0 0 0 0 1 0 15586.66 1
        "CAN" "SGP"        0  20630 1 171 1 791 1 0 0 0 0 0 0 0 0 1 0 15022.44 1
        "CAN" "IND"     8346 330129 1  93 1 424 1 0 0 0 0 0 0 0 0 1 0 11643.63 0
        "CAN" "USA"     7166 530500 1 205 1 946 1 0 0 0 0 0 0 0 1 1 0 548.3946 1
        "CAN" "SAU"   135819 230910 1 168 1 776 1 0 0 0 0 0 0 0 0 0 0 10655.83 0
        "CAN" "PHL"   117480 330112 1 157 1 725 1 0 0 0 0 0 0 0 0 1 0 13226.18 0
        "CAN" "USA" 15869550 240220 1 205 1 946 1 0 0 0 0 0 0 0 1 1 0 548.3946 1
        "CAN" "NLD"        0  20322 1 147 1 680 1 0 0 0 0 0 0 0 0 0 0 5988.239 1
        "CAN" "NZL"        0 110419 1 151 1 697 1 0 0 0 0 0 0 0 0 1 0 14308.33 1
        "CAN" "TTO"     1059  71339 1 196 1 901 1 0 0 0 0 0 0 0 0 1 0 4058.435 0
        "CAN" "DEU"        0 220820 1  54 1 248 1 0 0 0 0 0 0 0 0 0 0 6160.559 1
        "CAN" "CHN"        0  20321 1  39 1 173 1 0 0 0 0 0 0 0 0 0 0 10598.32 0
        "CAN" "KWT"        0 200990 1 111 1 508 1 0 0 0 0 0 0 0 0 0 0 10302.77 0
        "CAN" "DOM"        0  90962 1  58 1 267 1 0 0 0 0 0 0 0 0 0 0 2939.963 0
        end
        I appreciate your time and assistance. Please let me know if you need any more information in order to understand the dataset. Thank you kindly.

        Comment


        • #19
          This example cannot run your code. It does not contain the year variable that is critical to defining the local macros t and jt_ref. Amd without `jt_ref' your ppml references to IMP_TIME_FE_`jt_ref' becomes just IMP_TIME_FE_, which is, indeed, ambiguous as among all of the IMP_TIME_FE_* variables. Perhaps you are having the same difficulty. But I suspect not, because this problem also causes error messages before you ever reach the -ppml- command.

          Please post a new data example that runs with the code up until the point of the -ppml- command and then produces the error message you are getting. There is nothing more I can do for you without that. If you cannot come up with such a data set, then provide one that produces an error message before that. But please do not waste your time or mine with a data set that doesn't include every one of the variables mentioned in the code.

          Comment


          • #20
            My sincerest apologies! The main dataset has a lot of variables and I could not include all in the dataex due to the limit on the number of variables. It was my mistake to not include the year variable and I apologize for the oversight. Here is a new data example;

            Code:
            * Example generated by -dataex-. For more info, type help dataex
            clear
            input str3 exporter str8 importer float value long hs06 float(year i j it jt) byte(EXP_TIME_FE_1 EXP_TIME_FE_2 EXP_TIME_FE_3 EXP_TIME_FE_4 EXP_TIME_FE_5 IMP_TIME_FE_1 IMP_TIME_FE_2 IMP_TIME_FE_3) float(contig comlang colties) double dist float fta
            "CAN" "USA"    19815 230320 2018 1 205 1 946 1 0 0 0 0 0 0 0 1 1 0 548.3946 1
            "CAN" "FRA"      200 200979 2018 1  70 1 316 1 0 0 0 0 0 0 0 0 0 1 6004.645 1
            "CAN" "CYM"     2491 200989 2018 1  51 1 233 1 0 0 0 0 0 0 0 0 1 0 2716.584 0
            "CAN" "FRA"        0  30333 2018 1  70 1 316 1 0 0 0 0 0 0 0 0 0 1 6004.645 1
            "CAN" "JPN"  1415541 121410 2018 1 103 1 470 1 0 0 0 0 0 0 0 0 0 0 10358.49 1
            "CAN" "SGP"        0 350290 2018 1 171 1 791 1 0 0 0 0 0 0 0 0 1 0 15022.44 1
            "CAN" "ZMB"        0 210690 2018 1 215 1 991 1 0 0 0 0 0 0 0 0 1 0 12609.73 0
            "CAN" "DOM"        0 120590 2018 1  58 1 267 1 0 0 0 0 0 0 0 0 0 0 2939.963 0
            "CAN" "FRA"     4169 220299 2018 1  70 1 316 1 0 0 0 0 0 0 0 0 0 1 6004.645 1
            "CAN" "PAN"        0  20319 2018 1 154 1 712 1 0 0 0 0 0 0 0 0 0 0   3862.1 1
            "CAN" "MAR"        0  51110 2018 1 124 1 570 1 0 0 0 0 0 0 0 0 0 0 6177.698 0
            "CAN" "TWN"   102344  70200 2018 1 199 1 916 1 0 0 0 0 0 0 0 0 0 0 12090.98 0
            "CAN" "KNA"    14750  30559 2018 1 109 1 498 1 0 0 0 0 0 0 0 0 1 0 3327.077 0
            "CAN" "USA"  1895860 170240 2018 1 205 1 946 1 0 0 0 0 0 0 0 1 1 0 548.3946 1
            "CAN" "COL"   148878 180620 2018 1  44 1 198 1 0 0 0 0 0 0 0 0 0 0 4363.174 1
            "CAN" "USA"    68858 100410 2018 1 205 1 946 1 0 0 0 0 0 0 0 1 1 0 548.3946 1
            "CAN" "CHN"        0 190490 2018 1  39 1 173 1 0 0 0 0 0 0 0 0 0 0 10598.32 0
            "CAN" "USA"   427614  40390 2018 1 205 1 946 1 0 0 0 0 0 0 0 1 1 0 548.3946 1
            "CAN" "JPN"        0 330210 2018 1 103 1 470 1 0 0 0 0 0 0 0 0 0 0 10358.49 1
            "CAN" "PER"        0  40410 2018 1 156 1 720 1 0 0 0 0 0 0 0 0 0 0 6209.441 1
            "CAN" "BRB"     2330 110412 2018 1  32 1 146 1 0 0 0 0 0 0 0 0 1 0 3889.655 0
            "CAN" "GUY"        0 151419 2018 1  85 1 388 1 0 0 0 0 0 0 0 0 1 0 4597.552 0
            "CAN" "EST"        0  51110 2018 1  65 1 295 1 0 0 0 0 0 0 0 0 0 0 6645.816 1
            "CAN" "PER"        0 200990 2018 1 156 1 720 1 0 0 0 0 0 0 0 0 0 0 6209.441 1
            "CAN" "HKG"        0  30811 2018 1  86 1 393 1 0 0 0 0 0 0 0 0 1 0 12568.15 0
            "CAN" "CRI"    15229 100830 2018 1  47 1 213 1 0 0 0 0 0 0 0 0 0 0 3774.394 1
            "CAN" "SLE"    62414 220710 2018 1 173 1 798 1 0 0 0 0 0 0 0 0 1 0 7448.309 0
            "CAN" "LBN"        0 220710 2018 1 113 1 518 1 0 0 0 0 0 0 0 0 0 0 9173.474 0
            "CAN" "TTO"    32169  20726 2018 1 196 1 901 1 0 0 0 0 0 0 0 0 1 0 4058.435 0
            "CAN" "CYM"        0 200971 2018 1  51 1 233 1 0 0 0 0 0 0 0 0 1 0 2716.584 0
            "CAN" "ESP"        0 330112 2018 1  64 1 290 1 0 0 0 0 0 0 0 0 0 0 6040.498 1
            "CAN" "ARE"        0 200599 2018 1   7 1  27 1 0 0 0 0 0 0 0 0 0 0  11105.9 0
            "CAN" "NLD"   488272 190532 2018 1 147 1 680 1 0 0 0 0 0 0 0 0 0 0 5988.239 1
            "CAN" "GTM"        0 210320 2018 1  83 1 378 1 0 0 0 0 0 0 0 0 0 0 3398.818 0
            "CAN" "NGA"        0 210500 2018 1 144 1 669 1 0 0 0 0 0 0 0 0 1 0  8946.49 0
            "CAN" "USA"   347142 220110 2018 1 205 1 946 1 0 0 0 0 0 0 0 1 1 0 548.3946 1
            "CAN" "POL"        0 430180 2018 1 159 1 735 1 0 0 0 0 0 0 0 0 0 0 6925.886 1
            "CAN" "FRA"       36 190190 2018 1  70 1 316 1 0 0 0 0 0 0 0 0 0 1 6004.645 1
            "CAN" "VNM"   159268  20329 2018 1 210 1 971 1 0 0 0 0 0 0 0 0 0 0 12816.55 1
            "CAN" "BRB"      213 190219 2018 1  32 1 146 1 0 0 0 0 0 0 0 0 1 0 3889.655 0
            "CAN" "BRB"        0 210390 2018 1  32 1 146 1 0 0 0 0 0 0 0 0 1 0 3889.655 0
            "CAN" "ATG"        0  71320 2018 1  13 1  51 1 0 0 0 0 0 0 0 0 1 0 3382.002 0
            "CAN" "VEN"  9945001 100199 2018 1 208 1 961 1 0 0 0 0 0 0 0 0 0 0 3871.308 0
            "CAN" "NPL"    14129  10512 2018 1 149 1 690 1 0 0 0 0 0 0 0 0 0 0 11940.37 0
            "CAN" "IRN"        0 180690 2018 1  96 1 435 1 0 0 0 0 0 0 0 0 0 0 9900.537 0
            "CAN" "GBR"    41202  80929 2018 1  72 1 326 1 0 0 0 0 0 0 0 0 1 1 5715.747 0
            "CAN" "VNM"        0  70110 2018 1 210 1 971 1 0 0 0 0 0 0 0 0 0 0 12816.55 1
            "CAN" "GRD"        0  20622 2018 1  81 1 368 1 0 0 0 0 0 0 0 0 1 0  3901.79 0
            "CAN" "BRB"        0  60420 2018 1  32 1 146 1 0 0 0 0 0 0 0 0 1 0 3889.655 0
            "CAN" "MEX"        0  80810 2018 1 128 1 589 1 0 0 0 0 0 0 0 0 0 0  3267.29 1
            "CAN" "CHE"    39129  90300 2018 1  37 1 163 1 0 0 0 0 0 0 0 0 0 0 6440.717 1
            "CAN" "GTM"        0  40210 2018 1  83 1 378 1 0 0 0 0 0 0 0 0 0 0 3398.818 0
            "CAN" "BRB"        0 220190 2018 1  32 1 146 1 0 0 0 0 0 0 0 0 1 0 3889.655 0
            "CAN" "MEX"        0  70110 2018 1 128 1 589 1 0 0 0 0 0 0 0 0 0 0  3267.29 1
            "CAN" "GRC"        0 350400 2018 1  80 1 363 1 0 0 0 0 0 0 0 0 0 0 8103.304 1
            "CAN" "KOR"        0  10310 2018 1 110 1 503 1 0 0 0 0 0 0 0 0 0 0  10617.7 1
            "CAN" "FRA"   141196 110100 2018 1  70 1 316 1 0 0 0 0 0 0 0 0 0 1 6004.645 1
            "CAN" "DEU"    23590  40711 2018 1  54 1 248 1 0 0 0 0 0 0 0 0 0 0 6160.559 1
            "CAN" "BRB"     2216 200520 2018 1  32 1 146 1 0 0 0 0 0 0 0 0 1 0 3889.655 0
            "CAN" "PHL"        0 410190 2018 1 157 1 725 1 0 0 0 0 0 0 0 0 1 0 13226.18 0
            "CAN" "USA"    22840 180100 2018 1 205 1 946 1 0 0 0 0 0 0 0 1 1 0 548.3946 1
            "CAN" "SLV"        0 200799 2018 1 174 1 803 1 0 0 0 0 0 0 0 0 0 0 3465.451 0
            "CAN" "JAM"        0  20910 2018 1 101 1 460 1 0 0 0 0 0 0 0 0 1 0 2868.783 0
            "CAN" "SPM"      783  21011 2018 1 176 1 813 1 0 0 0 0 0 0 0 0 0 0 1845.482 0
            "CAN" "JPN" 16303176  20329 2018 1 103 1 470 1 0 0 0 0 0 0 0 0 0 0 10358.49 1
            "CAN" "SPM"      117  71220 2018 1 176 1 813 1 0 0 0 0 0 0 0 0 0 0 1845.482 0
            "CAN" "CHN"   445375  30499 2018 1  39 1 173 1 0 0 0 0 0 0 0 0 0 0 10598.32 0
            "CAN" "CUB"        0 121221 2018 1  48 1 218 1 0 0 0 0 0 0 0 0 0 0 2302.272 0
            "CAN" "DEU"        0  30363 2018 1  54 1 248 1 0 0 0 0 0 0 0 0 0 0 6160.559 1
            "CAN" "DEU"  5024591 170220 2018 1  54 1 248 1 0 0 0 0 0 0 0 0 0 0 6160.559 1
            "CAN" "BFA"        0 200580 2018 1  21 1  91 1 0 0 0 0 0 0 0 0 0 0 8088.204 0
            "CAN" "DEU"        0 120799 2018 1  54 1 248 1 0 0 0 0 0 0 0 0 0 0 6160.559 1
            "CAN" "VCT"   128199  30559 2018 1 207 1 956 1 0 0 0 0 0 0 0 0 1 0 3806.961 0
            "CAN" "ARE"        0 120750 2018 1   7 1  27 1 0 0 0 0 0 0 0 0 0 0  11105.9 0
            "CAN" "PHL"        0 200559 2018 1 157 1 725 1 0 0 0 0 0 0 0 0 1 0 13226.18 0
            "CAN" "JPN"     1229 210120 2018 1 103 1 470 1 0 0 0 0 0 0 0 0 0 0 10358.49 1
            "CAN" "URY"   134662  71340 2018 1 204 1 941 1 0 0 0 0 0 0 0 0 0 0   9055.5 0
            "CAN" "POL"        0  10512 2018 1 159 1 735 1 0 0 0 0 0 0 0 0 0 0 6925.886 1
            "CAN" "ESP"        0  30389 2018 1  64 1 290 1 0 0 0 0 0 0 0 0 0 0 6040.498 1
            "CAN" "EGY"        0 230990 2018 1  61 1 282 1 0 0 0 0 0 0 0 0 0 0 9217.863 0
            "CAN" "TGO"        0 190240 2018 1 190 1 879 1 0 0 0 0 0 0 0 0 0 0 8797.691 0
            "CAN" "CHN"     2480  90121 2018 1  39 1 173 1 0 0 0 0 0 0 0 0 0 0 10598.32 0
            "CAN" "HKG"        0  30489 2018 1  86 1 393 1 0 0 0 0 0 0 0 0 1 0 12568.15 0
            "CAN" "AUS"        0 200897 2018 1  14 1  56 1 0 0 0 0 0 0 0 0 1 0 15586.66 1
            "CAN" "MEX"        0  10619 2018 1 128 1 589 1 0 0 0 0 0 0 0 0 0 0  3267.29 1
            "CAN" "HKG"   892416 120190 2018 1  86 1 393 1 0 0 0 0 0 0 0 0 1 0 12568.15 0
            "CAN" "AUS"   215825  20322 2018 1  14 1  56 1 0 0 0 0 0 0 0 0 1 0 15586.66 1
            "CAN" "SGP"        0  20630 2018 1 171 1 791 1 0 0 0 0 0 0 0 0 1 0 15022.44 1
            "CAN" "IND"     8346 330129 2018 1  93 1 424 1 0 0 0 0 0 0 0 0 1 0 11643.63 0
            "CAN" "USA"     7166 530500 2018 1 205 1 946 1 0 0 0 0 0 0 0 1 1 0 548.3946 1
            "CAN" "SAU"   135819 230910 2018 1 168 1 776 1 0 0 0 0 0 0 0 0 0 0 10655.83 0
            "CAN" "PHL"   117480 330112 2018 1 157 1 725 1 0 0 0 0 0 0 0 0 1 0 13226.18 0
            "CAN" "USA" 15869550 240220 2018 1 205 1 946 1 0 0 0 0 0 0 0 1 1 0 548.3946 1
            "CAN" "NLD"        0  20322 2018 1 147 1 680 1 0 0 0 0 0 0 0 0 0 0 5988.239 1
            "CAN" "NZL"        0 110419 2018 1 151 1 697 1 0 0 0 0 0 0 0 0 1 0 14308.33 1
            "CAN" "TTO"     1059  71339 2018 1 196 1 901 1 0 0 0 0 0 0 0 0 1 0 4058.435 0
            "CAN" "DEU"        0 220820 2018 1  54 1 248 1 0 0 0 0 0 0 0 0 0 0 6160.559 1
            "CAN" "CHN"        0  20321 2018 1  39 1 173 1 0 0 0 0 0 0 0 0 0 0 10598.32 0
            "CAN" "KWT"        0 200990 2018 1 111 1 508 1 0 0 0 0 0 0 0 0 0 0 10302.77 0
            "CAN" "DOM"        0  90962 2018 1  58 1 267 1 0 0 0 0 0 0 0 0 0 0 2939.963 0
            end
            The IMP_TIME_FE variable ranges from 1 to 1000, that is, there are variables in the dataset from IMP_TIME_FE_1 all the way to IMP_TIME_FE_1000. I could not include all because of the variable limit in dataex. EXP_TIME_FE however only ranged from 1 to 5, and I was able to include all. These dummies were generated with this code;

            egen i = group(exporter)
            egen j = group(importer)
            egen it = group(i year)
            egen jt = group (j year)
            quietly tab it, gen(EXP_TIME_FE_)
            quietly tab jt, gen(IMP_TIME_FE_)


            I appreciate your time and patience. Thank you!

            Comment


            • #21
              Thank you. You still missed one variable: lndist. But by its name I'm inferring that it is the logarithm of dist, and so it was easy to add to the data.

              Following the advice I gave earlier: run the code uninterrupted from start to finish, and remove the quotes from the variable lists in the -ppml- command, the code runs without producing the error message you are encountering. The -ppml- command complains that the values of the dependent variable (value) are too large. But rescaling those by a factor of 100,000, it runs without complaints. It removes many of the IMP_TIME_FE* and EXP_TIME_FE* variables, but that is expected because there are only 100 observations in the example. (To be clear, I'm not complaining about the limited size of the example: it was large enough to resolve the questions you were asking.)

              So you can see the code exactly as I ran it, and the results:
              Code:
              . drop i j it jt *_TIME_* // THESE WILL BE CREATED IN NEXT FEW COMMANDS
              
              . *creating dummies for exporter-time- and importer-time FEs:
              . egen i = group(exporter)
              
              . egen j = group(importer)
              
              . egen it = group(i year)
              
              . egen jt = group (j year)
              
              . quietly tab it, gen(EXP_TIME_FE_)
              
              . quietly tab jt, gen(IMP_TIME_FE_)
              
              .
              . *creating macros for dropping baseline-countries importer-time FEs in estimation
              . sum it
              
                  Variable |        Obs        Mean    Std. dev.       Min        Max
              -------------+---------------------------------------------------------
                        it |        100           1           0          1          1
              
              . local it=`r(max)'                    /* number of exporting country-years in sample */
              
              . sum year
              
                  Variable |        Obs        Mean    Std. dev.       Min        Max
              -------------+---------------------------------------------------------
                      year |        100        2018           0       2018       2018
              
              . local t = `r(max)'-`r(min)'+1         /* number of years in sample */
              
              . sum jt
              
                  Variable |        Obs        Mean    Std. dev.       Min        Max
              -------------+---------------------------------------------------------
                        jt |        100       27.02    16.63147          1         55
              
              . local jt_ref = `r(max)'- `t'        /* number of importer-years without reference country */
              
              . local jt_all = `r(max)'                /* number of importer-years with reference country */
              
              . scalar jt_first_ref = `jt_ref' + 1     /* number of the first reference importer-year among all jt */
              
              . di jt_first_ref
              55
              
              . di `jt_ref'
              54
              
              . di `jt_all'
              55
              
              . di `t'
              1
              
              . di `it'
              1
              
              .
              . *******************************************************************************
              . *            Run this part to get estimates for the relevant fixed effects    *
              . *             Estimates are stored in FE_model.ster for faster computation    *
              . *******************************************************************************
              .
              . //  log using ppmlhdfe_log, replace
              . gen lndist = log(dist)
              
              . timer clear 1
              
              . timer on 1
              
              . gen _value = value/100000 // ORIGINAL ppml WITH value COMPLAINS THAT VALUES OF value ARE TOO LARGE AND SUGGESTS RESCALING
              
              . ppml _value EXP_TIME_FE_1-EXP_TIME_FE_`it' IMP_TIME_FE_1-IMP_TIME_FE_`jt_ref' lndist contig colties comlang fta
              
              note: checking the existence of the estimates
              
              Number of regressors excluded to ensure that the estimates exist: 32
              Excluded regressors:  EXP_TIME_FE_1 IMP_TIME_FE_1 IMP_TIME_FE_2 IMP_TIME_FE_4 IMP_TIME_FE_10 IMP_TIME_FE_13 IMP_TIME_FE_14 IMP_TIME_FE_15 IMP_
              > TIME_FE_16 IMP_TIME_FE_18 IMP_TIME_FE_19 IMP_TIME_FE_20 IMP_TIME_FE_21 IMP_TIME_FE_22 IMP_TIME_FE_25 IMP_TIME_FE_26 IMP_TIME_FE_29 IMP_TIME_
              > FE_30 IMP_TIME_FE_31 IMP_TIME_FE_32 IMP_TIME_FE_33 IMP_TIME_FE_34 IMP_TIME_FE_37 IMP_TIME_FE_38 IMP_TIME_FE_39 IMP_TIME_FE_41 IMP_TIME_FE_43
              >  IMP_TIME_FE_45 IMP_TIME_FE_47 IMP_TIME_FE_51 IMP_TIME_FE_53 contig
              Number of observations excluded: 36
              
              note: IMP_TIME_FE_17 omitted because of collinearity.
              
              note: starting ppml estimation
              note: _value has noninteger values
              
              Iteration 1:  Deviance =   1647.19
              Iteration 2:  Deviance =  1221.445
              Iteration 3:  Deviance =  1171.825
              Iteration 4:  Deviance =  1167.551
              Iteration 5:  Deviance =  1166.553
              Iteration 6:  Deviance =  1166.278
              Iteration 7:  Deviance =   1166.22
              Iteration 8:  Deviance =  1166.211
              Iteration 9:  Deviance =   1166.21
              Iteration 10: Deviance =  1166.209
              Iteration 11: Deviance =  1166.209
              Iteration 12: Deviance =  1166.209
              Iteration 13: Deviance =  1166.208
              Iteration 14: Deviance =  1166.208
              Iteration 15: Deviance =  1166.208
              Iteration 16: Deviance =  1166.208
              Iteration 17: Deviance =  1166.208
              
              Number of parameters: 28
              Number of observations: 64
              Pseudo log-likelihood: -626.95811
              R-squared: .29850181
              Option strict is: off
              --------------------------------------------------------------------------------
                             |               Robust
                      _value | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
              ---------------+----------------------------------------------------------------
               IMP_TIME_FE_3 |    26.9759          .        .       .            .           .
               IMP_TIME_FE_5 |   .1513867          .        .       .            .           .
               IMP_TIME_FE_6 |   8.481875          .        .       .            .           .
               IMP_TIME_FE_7 |   4.554598          .        .       .            .           .
               IMP_TIME_FE_8 |   6.321943          .        .       .            .           .
               IMP_TIME_FE_9 |   2.740646          .        .       .            .           .
              IMP_TIME_FE_11 |   -2.61978          .        .       .            .           .
              IMP_TIME_FE_12 |    11.3331          .        .       .            .           .
              IMP_TIME_FE_23 |   16.60762          .        .       .            .           .
              IMP_TIME_FE_24 |   12.34815          .        .       .            .           .
              IMP_TIME_FE_27 |   17.47696          .        .       .            .           .
              IMP_TIME_FE_28 |   1.671826          .        .       .            .           .
              IMP_TIME_FE_35 |   9.658793          .        .       .            .           .
              IMP_TIME_FE_36 |   3.555031          .        .       .            .           .
              IMP_TIME_FE_40 |    15.0381          .        .       .            .           .
              IMP_TIME_FE_42 |   4.796333          .        .       .            .           .
              IMP_TIME_FE_44 |   10.34926          .        .       .            .           .
              IMP_TIME_FE_46 |  -16.65432          .        .       .            .           .
              IMP_TIME_FE_48 |   3.574688          .        .       .            .           .
              IMP_TIME_FE_49 |   5.647675          .        .       .            .           .
              IMP_TIME_FE_50 |   3.326827          .        .       .            .           .
              IMP_TIME_FE_52 |   5.043774          .        .       .            .           .
              IMP_TIME_FE_54 |   15.36983          .        .       .            .           .
                      lndist |  -8.977481          .        .       .            .           .
                     colties |   7.557063          .        .       .            .           .
                     comlang |  -9.545486          .        .       .            .           .
                         fta |  -9.449872          .        .       .            .           .
                       _cons |   78.76575          .        .       .            .           .
              --------------------------------------------------------------------------------
              
              . // estimates save FE_model
              . // save FE_model_dataset
              . timer off 1
              
              . timer list
                 1:      0.33 /        1 =       0.3270
              
              . cap log close
              
              . ********************************************************************************
              . // estimates use FE_model
              .
              end of do-file
              I have put in bold face those aspects of your code that I have modified. Crucially, these modifications are mostly irrelevant to the problem you were having. I dropped the dummy variables at the beginning because I needed to run the code that created them, and you can't -gen- variables that already exist. I commented out any command that saves a file to disk because I don't like to save files on my drive that are other people's and not for my personal use. And I created the variable lndist. As you can see, the only relevant change I made is the fix that I previously suggested: removing the quotes from the -ppml- command. And, as you can see, it runs.

              Comment


              • #22
                Thank you so much, Clyde!! I greatly appreciate the time and patience you have put into helping me. I would try this again on my end and give you the feedback. Once again, I'm very grateful. Cheers.

                Comment


                • #23
                  UPDATE!

                  It worked! Thank you very much!

                  Comment


                  • #24
                    Another update! Clyde Schechter ! I'm sorry, I think I spoke too soon. The code actually ran and it solved the initial problem I had, but then a new problem popped up along the way after over 3hours of running the code. My explanation for this is probably because the number of observations in my dataset is 535,400 or because of the large number of variables, I may be wrong though. Here's the code;

                    Code:
                     timer clear 1
                    
                    . timer on 1
                    
                    . gen val = tot_val/100000
                    
                    . ppml val EXP_TIME_FE_1-EXP_TIME_FE_`it' IMP_TIME_FE_1-IMP_TIME_FE_`jt_ref' lndist contig colties comlang fta
                    
                    note: checking the existence of the estimates
                    
                    Number of regressors excluded to ensure that the estimates exist: 69
                    Excluded regressors:  IMP_TIME_FE_42 IMP_TIME_FE_43 IMP_TIME_FE_44 IMP_TIME_FE_45 IMP_TIME_FE_46 IMP_TIME_FE_47 I
                    > MP_TIME_FE_48 IMP_TIME_FE_49 IMP_TIME_FE_50 IMP_TIME_FE_86 IMP_TIME_FE_87 IMP_TIME_FE_88 IMP_TIME_FE_89 IMP_TIM
                    > E_FE_90 IMP_TIME_FE_188 IMP_TIME_FE_189 IMP_TIME_FE_190 IMP_TIME_FE_191 IMP_TIME_FE_192 IMP_TIME_FE_223 IMP_TIM
                    > E_FE_224 IMP_TIME_FE_225 IMP_TIME_FE_226 IMP_TIME_FE_227 IMP_TIME_FE_329 IMP_TIME_FE_383 IMP_TIME_FE_384 IMP_TI
                    > ME_FE_385 IMP_TIME_FE_386 IMP_TIME_FE_387 IMP_TIME_FE_398 IMP_TIME_FE_429 IMP_TIME_FE_567 IMP_TIME_FE_568 IMP_T
                    > IME_FE_569 IMP_TIME_FE_614 IMP_TIME_FE_615 IMP_TIME_FE_616 IMP_TIME_FE_617 IMP_TIME_FE_618 IMP_TIME_FE_761 IMP_
                    > TIME_FE_762 IMP_TIME_FE_763 IMP_TIME_FE_764 IMP_TIME_FE_765 IMP_TIME_FE_818 IMP_TIME_FE_819 IMP_TIME_FE_820 IMP
                    > _TIME_FE_821 IMP_TIME_FE_822 IMP_TIME_FE_823 IMP_TIME_FE_824 IMP_TIME_FE_825 IMP_TIME_FE_826 IMP_TIME_FE_827 IM
                    > P_TIME_FE_856 IMP_TIME_FE_857 IMP_TIME_FE_858 IMP_TIME_FE_859 IMP_TIME_FE_860 IMP_TIME_FE_895 IMP_TIME_FE_896 I
                    > MP_TIME_FE_897 IMP_TIME_FE_936 IMP_TIME_FE_937 IMP_TIME_FE_938 IMP_TIME_FE_939 IMP_TIME_FE_940 IMP_TIME_FE_948
                    Number of observations excluded: 0
                    
                    note: EXP_TIME_FE_4 omitted because of collinearity.
                    note: IMP_TIME_FE_26 omitted because of collinearity.
                    note: IMP_TIME_FE_552 omitted because of collinearity.
                    
                    note: starting ppml estimation
                    note: val has noninteger values
                    
                    Iteration 1:  Deviance =  4.78e+08
                    Iteration 2:  Deviance =  1.47e+08
                    Iteration 3:  Deviance =  7.94e+07
                    Iteration 4:  Deviance =  6.21e+07
                    Iteration 5:  Deviance =  5.78e+07
                    Iteration 6:  Deviance =  5.67e+07
                    Iteration 7:  Deviance =  5.65e+07
                    Iteration 8:  Deviance =  5.65e+07
                    Iteration 9:  Deviance =  5.65e+07
                    Iteration 10: Deviance =  5.65e+07
                    Iteration 11: Deviance =  5.65e+07
                    Iteration 12: Deviance =  5.65e+07
                    Iteration 13: Deviance =  5.65e+07
                    Iteration 14: Deviance =  5.65e+07
                    Iteration 15: Deviance =  5.65e+07
                    Iteration 16: Deviance =  5.65e+07
                    Iteration 17: Deviance =  5.65e+07
                    Iteration 18: Deviance =  5.65e+07
                    Iteration 19: Deviance =  5.65e+07
                    Iteration 20: Deviance =  5.65e+07
                    Iteration 21: Deviance =  5.65e+07
                    Iteration 22: Deviance =  5.65e+07
                    Iteration 23: Deviance =  5.65e+07
                    Iteration 24: Deviance =  5.65e+07
                    Iteration 25: Deviance =  5.65e+07
                    Iteration 26: Deviance =  5.65e+07
                    Iteration 27: Deviance =  5.65e+07
                    Iteration 28: Deviance =  5.65e+07
                    Iteration 29: Deviance =  5.65e+07
                    Iteration 30: Deviance =  5.65e+07
                    Iteration 31: Deviance =  5.65e+07
                    Iteration 32: Deviance =  5.65e+07
                    Iteration 33: Deviance =  5.65e+07
                    Iteration 34: Deviance =  5.65e+07
                    Iteration 35: Deviance =  5.65e+07
                    Iteration 36: Deviance =  5.65e+07
                    Iteration 37: Deviance =  5.65e+07
                    Iteration 38: Deviance =  5.65e+07
                    Iteration 39: Deviance =  5.65e+07
                    Iteration 40: Deviance =  5.65e+07
                    Iteration 41: Deviance =  5.65e+07
                    Iteration 42: Deviance =  5.65e+07
                    Iteration 43: Deviance =  5.65e+07
                    Iteration 44: Deviance =  5.65e+07
                    Iteration 45: Deviance =  5.65e+07
                    Iteration 46: Deviance =  5.65e+07
                    Iteration 47: Deviance =  5.65e+07
                    Iteration 48: Deviance =  5.65e+07
                    Iteration 49: Deviance =  5.65e+07
                    Iteration 50: Deviance =  5.65e+07
                    Iteration 51: Deviance =  5.65e+07
                    Iteration 52: Deviance =  5.65e+07
                    Iteration 53: Deviance =  5.65e+07
                    Iteration 54: Deviance =  5.65e+07
                    Iteration 55: Deviance =  5.65e+07
                    Iteration 56: Deviance =  5.65e+07
                    Iteration 57: Deviance =  5.65e+07
                    Iteration 58: Deviance =  5.65e+07
                    Iteration 59: Deviance =  5.65e+07
                    Iteration 60: Deviance =  5.65e+07
                    Iteration 61: Deviance =  5.65e+07
                    Iteration 62: Deviance =  5.65e+07
                    Iteration 63: Deviance =  5.65e+07
                    Iteration 64: Deviance =  5.65e+07
                    Iteration 65: Deviance =  5.65e+07
                    Iteration 66: Deviance =  5.65e+07
                    Iteration 67: Deviance =  5.65e+07
                    Iteration 68: Deviance =  5.65e+07
                    Iteration 69: Deviance =  5.65e+07
                    Iteration 70: Deviance =  5.65e+07
                    Iteration 71: Deviance =  5.65e+07
                    Iteration 72: Deviance =  5.65e+07
                    Iteration 73: Deviance =  5.65e+07
                    Iteration 74: Deviance =  5.65e+07
                    Iteration 75: Deviance =  5.65e+07
                    Iteration 76: Deviance =  5.65e+07
                    Iteration 77: Deviance =  6.45e+24
                    Iteration 78: Deviance =  2.48e+24
                    Iteration 79: Deviance =  4.40e+24
                    Iteration 80: Deviance =  1.62e+24
                    Iteration 81: Deviance =  5.96e+23
                    Iteration 82: Deviance =  2.19e+23
                    Iteration 83: Deviance =  8.06e+22
                    Iteration 84: Deviance =  2.97e+22
                    Iteration 85: Deviance =  1.09e+22
                    Iteration 86: Deviance =  4.01e+21
                    Iteration 87: Deviance =  1.48e+21
                    Iteration 88: Deviance =  5.43e+20
                    matrix not positive definite // new error message
                    r(459);
                    
                    end of do-file

                    Comment


                    • #25
                      I'm afraid I can't help you with this. This is a convergence problem in -ppml-, a program whose inner workings I know nothing about.

                      The large number of observations and variables is indeed the reason it took a few hours for the problem to show up. But it's a problem nonetheless.

                      You need somebody who knows and understands -ppml- to look at this. That is unlikely to happen on this thread, because it is really off topic. I suggest you start a new thread for this, and make sure to mention -ppml- in the title.

                      Comment


                      • #26
                        I'll do that. Thank you.

                        Comment


                        • #27
                          Hello Clyde Schechter Please I need your help again with a data merging issue. You helped me with a similar problem the last time and I've successfully used that method to merge other datasets up until now. I've encountered a problem. I have the using dataset with variables like importer, bico, year, and tariff, which I want to merge with the master dataset with variables like importer, bico, year etc. Because the using dataset has the same product codes for different countries from 2018 to 2021, anytime I try to merge with the code below, it says none of the three variables uniquely identifies observations in my using dataset. What I am trying to do exactly is to match the datasets using a combination of importer, bico and year.

                          Code:
                          use "MR_trade_tariff.dta", clear
                          merge m:1 importer bico year using tariff_dataset.dta, keep(match master) ///
                              keepusing(prod_name prod_no tariff)
                          Here is a snippet of the master dataset;

                          Code:
                          * Example generated by -dataex-. For more info, type help dataex
                          clear
                          input str3 exporter str8 importer float year int bico byte month_id float(tot_bico_bval tot_bico_ival tot_bico_hval tot_cropval tot_fbval tot_hortval)
                          "CAN" "ABW" 2018 203 10    .     0      .  2115     .      .
                          "CAN" "ABW" 2022 310  6    .     .  26954     .     .  25802
                          "CAN" "ABW" 2022 213  1    . 60160      . 17248     .      .
                          "CAN" "ABW" 2019 304  2    .     . 157142     .     .      .
                          "CAN" "ABW" 2018 213 12    . 22097      . 17061     .      .
                          "CAN" "ABW" 2022 213  8    . 57043      . 11457     .      .
                          "CAN" "ABW" 2022 304  9    .     .  44567     .     .      .
                          "CAN" "ABW" 2018 213  5    . 46846      . 67736     .      .
                          "CAN" "ABW" 2018 306  3    .     .  55525     .     .  52708
                          "CAN" "ABW" 2021 213  9    . 48085      .  8508     .      .
                          "CAN" "ABW" 2018 310  9    .     .  48610     .     .  21773
                          "CAN" "ABW" 2021 304  6    .     .  99865     .     .      .
                          "CAN" "ABW" 2020 204  9    .  3072      .  5869     .      .
                          "CAN" "ABW" 2021 213 10    .     0      .     0     .      .
                          "CAN" "ABW" 2019 306  8    .     . 198874     .     . 152175
                          "CAN" "ABW" 2021 310  1    .     .  13117     .     .      0
                          "CAN" "ABW" 2019 304  9    .     .  81589     .     .      .
                          "CAN" "ABW" 2020 101  2 1732     .      . 56961     .      .
                          "CAN" "ABW" 2020 213  3    . 11121      . 13867     .      .
                          "CAN" "ABW" 2021 215  2    .     0      .     .  4516      .
                          "CAN" "ABW" 2022 312  4    .     . 331086     .     .      .
                          "CAN" "ABW" 2021 204 12    .     0      .  5146     .      .
                          "CAN" "ABW" 2021 310  8    .     .  41197     .     .  24791
                          "CAN" "ABW" 2021 312  7    .     .  16914     .     .      .
                          "CAN" "ABW" 2021 313  5    .     .  19238     .     .      0
                          "CAN" "ABW" 2019 207 10    . 67881      . 72342     .      .
                          "CAN" "ABW" 2020 213 11    .  5109      . 11246     .      .
                          "CAN" "ABW" 2022 213 11    . 42912      .  8946     .      .
                          "CAN" "ABW" 2020 304  5    .     .  76380     .     .      .
                          "CAN" "ABW" 2019 304 11    .     . 554245     .     .      .
                          "CAN" "ABW" 2022 204  3    .  4018      . 42625     .      .
                          "CAN" "ABW" 2020 304  4    .     .  51669     .     .      .
                          "CAN" "ABW" 2022 301  5    .     .  41434     .  4467      .
                          "CAN" "ABW" 2020 304  6    .     .   3148     .     .      .
                          "CAN" "ABW" 2020 302  8    .     . 174394 31457     .      .
                          "CAN" "ABW" 2019 306  6    .     . 144260     .     . 137028
                          "CAN" "ABW" 2021 204 11    .     0      .     0     .      .
                          "CAN" "ABW" 2019 203  7    . 43981      .     .     .      .
                          "CAN" "ABW" 2019 101 12    0     .      .  4126     .      .
                          "CAN" "ABW" 2020 204  7    . 30307      . 57233     .      .
                          "CAN" "ABW" 2018 213  2    .     0      .  9021     .      .
                          "CAN" "ABW" 2021 310  4    .     .      0     .     .      0
                          "CAN" "ABW" 2019 316  4    .     . 110589 19158     .      .
                          "CAN" "ABW" 2020 312  1    .     . 168011     .     .      .
                          "CAN" "ABW" 2020 213 10    . 23946      . 28033     .      .
                          "CAN" "ABW" 2019 304  1    .     . 168430     .     .      .
                          "CAN" "ABW" 2020 310 12    .     .  66235     .     .  61064
                          "CAN" "ABW" 2019 104  3 1591     .      .     . 24195      .
                          "CAN" "ABW" 2018 213  6    . 25002      .  3875     .      .
                          "CAN" "ABW" 2018 310  4    .     . 115813     .     .  92004
                          "CAN" "ABW" 2022 204 12    .     0      .     0     .      .
                          "CAN" "ABW" 2022 310 10    .     . 148568     .     . 121474
                          "CAN" "ABW" 2018 304  8    .     . 142762     .     .      .
                          "CAN" "ABW" 2018 203  1    . 18613      . 26541     .      .
                          "CAN" "ABW" 2022 204  7    . 20642      . 20642     .      .
                          "CAN" "ABW" 2021 303  3    .     .  52055     .  7959      .
                          "CAN" "ABW" 2022 101  2    0     .      .     0     .      .
                          "CAN" "ABW" 2019 213  5    .     0      .  3725     .      .
                          "CAN" "ABW" 2018 302  7    .     . 206071 61569     .      .
                          "CAN" "ABW" 2018 304 11    .     . 340166     .     .      .
                          "CAN" "AFG" 2018 105  6    0     .      .     0     .      .
                          "CAN" "AFG" 2022 304  5    .     .      0     .     .      .
                          "CAN" "AFG" 2019 101 11    0     .      .     0     .      .
                          "CAN" "AFG" 2019 212  4    .     0      .     .     .      .
                          "CAN" "AFG" 2020 212  8    .  9090      .     .     .      .
                          "CAN" "AFG" 2018 308 12    .     .   7844     . 18901      .
                          "CAN" "AFG" 2019 304  7    .     .      0     .     .      .
                          "CAN" "AFG" 2021 312 12    .     .      0     .     .      .
                          "CAN" "AFG" 2018 308 10    .     .      0     .     0      .
                          "CAN" "AFG" 2022 304  1    .     .      0     .     .      .
                          "CAN" "AFG" 2019 301  2    .     .  29949     .   200      .
                          "CAN" "AFG" 2021 304  9    .     .      0     .     .      .
                          "CAN" "AFG" 2019 202  5    .     0      .     0     .      .
                          "CAN" "AFG" 2020 312  2    .     .      0     .     .      .
                          "CAN" "AFG" 2020 209  1    .     0      .     .     .      .
                          "CAN" "AFG" 2021 304  3    .     .      0     .     .      .
                          "CAN" "AFG" 2019 304 10    .     .      0     .     .      .
                          "CAN" "AFG" 2018 104  2    0     .      .     .     0      .
                          "CAN" "AFG" 2020 209  5    . 99089      .     .     .      .
                          "CAN" "AFG" 2022 304  4    .     .      0     .     .      .
                          "CAN" "AFG" 2018 206 11    .     0      .     0     .      .
                          "CAN" "AFG" 2021 304 11    .     .      0     .     .      .
                          "CAN" "AFG" 2022 304 10    .     .      0     .     .      .
                          "CAN" "AFG" 2019 304  3    .     . 147507     .     .      .
                          "CAN" "AFG" 2018 315  8    .     .      0     .     0      .
                          "CAN" "AFG" 2020 312  3    .     .      0     .     .      .
                          "CAN" "AFG" 2021 304  6    .     . 253528     .     .      .
                          "CAN" "AFG" 2020 312  9    .     . 270350     .     .      .
                          "CAN" "AFG" 2021 304 10    .     .      0     .     .      .
                          "CAN" "AFG" 2020 312  4    .     . 108766     .     .      .
                          "CAN" "AFG" 2019 304 12    .     .      0     .     .      .
                          "CAN" "AFG" 2021 312  7    .     .      0     .     .      .
                          "CAN" "AFG" 2019 312  9    .     .      0     .     .      .
                          "CAN" "AFG" 2020 209 11    .     0      .     .     .      .
                          "CAN" "AFG" 2019 212  8    .     0      .     .     .      .
                          "CAN" "AFG" 2020 209  6    .     0      .     .     .      .
                          "CAN" "AFG" 2021 304  5    .     .      0     .     .      .
                          "CAN" "AFG" 2022 304  6    .     .      0     .     .      .
                          "CAN" "AFG" 2018 315  9    .     . 102375     .     1      .
                          "CAN" "AFG" 2022 304  9    .     .      0     .     .      .
                          end
                          And here is a snippet of the using dataset;
                          Code:
                          * Example generated by -dataex-. For more info, type help dataex
                          clear
                          input str3 importer byte prod_no str50 prod_name int(bico year) double tariff str6 exporter
                          "CYM"  3 "FISH AND CRUSTACEANS, MOLLUSCS AND OTHER AQUATIC I" 201 2021      0 "Canada"
                          "CYM"  6 "LIVE TREES AND OTHER PLANTS; BULBS, ROOTS AND THE " 306 2021     12 "Canada"
                          "CYM"  7 "EDIBLE VEGETABLES AND CERTAIN ROOTS AND TUBERS"     213 2021   5.67 "Canada"
                          "CYM"  8 "EDIBLE FRUIT AND NUTS; PEEL OF CITRUS FRUIT OR MEL" 313 2021     22 "Canada"
                          "CYM"  9 "COFFEE, TEA, MATÉ AND SPICES"                      217 2021   3.67 "Canada"
                          "CYM" 10 "CEREALS"                                            101 2021      0 "Canada"
                          "CYM" 11 "PRODUCTS OF THE MILLING INDUSTRY; MALT; STARCHES; " 204 2021     22 "Canada"
                          "CYM" 12 "OIL SEEDS AND OLEAGINOUS FRUITS; MISCELLANEOUS GRA" 102 2021      0 "Canada"
                          "CYM" 15 "ANIMAL OR VEGETABLE FATS AND OILS AND THEIR CLEAVA" 203 2021     22 "Canada"
                          "CYM" 16 "PREPARATIONS OF MEAT, OF FISH OR OF CRUSTACEANS, M" 312 2021     22 "Canada"
                          "CYM" 17 "SUGARS AND SUGAR CONFECTIONERY"                     206 2021     11 "Canada"
                          "CYM" 19 "PREPARATIONS OF CEREALS, FLOUR, STARCH OR MILK; PA" 215 2021  18.33 "Canada"
                          "CYM" 20 "PREPARATIONS OF VEGETABLES, FRUIT, NUTS OR OTHER P" 310 2021     22 "Canada"
                          "CYM" 21 "MISCELLANEOUS EDIBLE PREPARATIONS"                  215 2021  14.67 "Canada"
                          "CYM" 22 "BEVERAGES, SPIRITS AND VINEGAR"                     301 2021 162.82 "Canada"
                          "CYM" 23 "RESIDUES AND WASTE FROM THE FOOD INDUSTRIES; PREPA" 202 2021     11 "Canada"
                          "CYM" 24 "TOBACCO AND MANUFACTURED TOBACCO SUBSTITUTES"       314 2021    102 "Canada"
                          "ATG"  2 "MEAT AND EDIBLE MEAT OFFAL"                         304 2018  20.42 "Canada"
                          "ATG"  2 "MEAT AND EDIBLE MEAT OFFAL"                         304 2019  20.28 "Canada"
                          "ATG"  2 "MEAT AND EDIBLE MEAT OFFAL"                         304 2020  20.28 "Canada"
                          "ATG"  2 "MEAT AND EDIBLE MEAT OFFAL"                         304 2021  20.28 "Canada"
                          "ATG"  3 "FISH AND CRUSTACEANS, MOLLUSCS AND OTHER AQUATIC I" 201 2018  13.65 "Canada"
                          "ATG"  3 "FISH AND CRUSTACEANS, MOLLUSCS AND OTHER AQUATIC I" 201 2019   6.33 "Canada"
                          "ATG"  3 "FISH AND CRUSTACEANS, MOLLUSCS AND OTHER AQUATIC I" 201 2020   6.33 "Canada"
                          "ATG"  3 "FISH AND CRUSTACEANS, MOLLUSCS AND OTHER AQUATIC I" 201 2021   6.33 "Canada"
                          "ATG"  4 "DAIRY PRODUCE; BIRDS' EGGS; NATURAL HONEY; EDIBLE " 212 2018  13.33 "Canada"
                          "ATG"  4 "DAIRY PRODUCE; BIRDS' EGGS; NATURAL HONEY; EDIBLE " 212 2019   1.67 "Canada"
                          "ATG"  4 "DAIRY PRODUCE; BIRDS' EGGS; NATURAL HONEY; EDIBLE " 212 2020   1.67 "Canada"
                          "ATG"  4 "DAIRY PRODUCE; BIRDS' EGGS; NATURAL HONEY; EDIBLE " 212 2021   1.67 "Canada"
                          "ATG"  6 "LIVE TREES AND OTHER PLANTS; BULBS, ROOTS AND THE " 306 2018     40 "Canada"
                          "ATG"  6 "LIVE TREES AND OTHER PLANTS; BULBS, ROOTS AND THE " 306 2019  17.33 "Canada"
                          "ATG"  6 "LIVE TREES AND OTHER PLANTS; BULBS, ROOTS AND THE " 306 2020  17.33 "Canada"
                          "ATG"  6 "LIVE TREES AND OTHER PLANTS; BULBS, ROOTS AND THE " 306 2021  17.33 "Canada"
                          "ATG"  7 "EDIBLE VEGETABLES AND CERTAIN ROOTS AND TUBERS"     213 2018  22.42 "Canada"
                          "ATG"  7 "EDIBLE VEGETABLES AND CERTAIN ROOTS AND TUBERS"     213 2019   23.5 "Canada"
                          "ATG"  7 "EDIBLE VEGETABLES AND CERTAIN ROOTS AND TUBERS"     213 2020   23.5 "Canada"
                          "ATG"  7 "EDIBLE VEGETABLES AND CERTAIN ROOTS AND TUBERS"     213 2021   23.5 "Canada"
                          "ATG"  8 "EDIBLE FRUIT AND NUTS; PEEL OF CITRUS FRUIT OR MEL" 313 2018     28 "Canada"
                          "ATG"  8 "EDIBLE FRUIT AND NUTS; PEEL OF CITRUS FRUIT OR MEL" 313 2019  35.28 "Canada"
                          "ATG"  8 "EDIBLE FRUIT AND NUTS; PEEL OF CITRUS FRUIT OR MEL" 313 2020  35.28 "Canada"
                          "ATG"  8 "EDIBLE FRUIT AND NUTS; PEEL OF CITRUS FRUIT OR MEL" 313 2021  35.28 "Canada"
                          "ATG"  9 "COFFEE, TEA, MATÉ AND SPICES"                      217 2018  16.67 "Canada"
                          "ATG"  9 "COFFEE, TEA, MATÉ AND SPICES"                      217 2019   22.5 "Canada"
                          "ATG"  9 "COFFEE, TEA, MATÉ AND SPICES"                      217 2020   22.5 "Canada"
                          "ATG"  9 "COFFEE, TEA, MATÉ AND SPICES"                      217 2021   22.5 "Canada"
                          "ATG" 10 "CEREALS"                                            101 2018      5 "Canada"
                          "ATG" 10 "CEREALS"                                            101 2019   12.5 "Canada"
                          "ATG" 10 "CEREALS"                                            101 2020   12.5 "Canada"
                          "ATG" 10 "CEREALS"                                            101 2021   12.5 "Canada"
                          "ATG" 11 "PRODUCTS OF THE MILLING INDUSTRY; MALT; STARCHES; " 204 2018   6.67 "Canada"
                          "ATG" 11 "PRODUCTS OF THE MILLING INDUSTRY; MALT; STARCHES; " 204 2019    7.5 "Canada"
                          "ATG" 11 "PRODUCTS OF THE MILLING INDUSTRY; MALT; STARCHES; " 204 2020    7.5 "Canada"
                          "ATG" 11 "PRODUCTS OF THE MILLING INDUSTRY; MALT; STARCHES; " 204 2021    7.5 "Canada"
                          "ATG" 12 "OIL SEEDS AND OLEAGINOUS FRUITS; MISCELLANEOUS GRA" 102 2018   1.16 "Canada"
                          "ATG" 12 "OIL SEEDS AND OLEAGINOUS FRUITS; MISCELLANEOUS GRA" 102 2019   1.25 "Canada"
                          "ATG" 12 "OIL SEEDS AND OLEAGINOUS FRUITS; MISCELLANEOUS GRA" 102 2020   1.25 "Canada"
                          "ATG" 12 "OIL SEEDS AND OLEAGINOUS FRUITS; MISCELLANEOUS GRA" 102 2021   1.25 "Canada"
                          "ATG" 13 "LAC; GUMS, RESINS AND OTHER VEGETABLE SAPS AND EXT" 214 2018   12.5 "Canada"
                          "ATG" 15 "ANIMAL OR VEGETABLE FATS AND OILS AND THEIR CLEAVA" 203 2018   23.5 "Canada"
                          "ATG" 15 "ANIMAL OR VEGETABLE FATS AND OILS AND THEIR CLEAVA" 203 2019     25 "Canada"
                          "ATG" 15 "ANIMAL OR VEGETABLE FATS AND OILS AND THEIR CLEAVA" 203 2020     25 "Canada"
                          "ATG" 15 "ANIMAL OR VEGETABLE FATS AND OILS AND THEIR CLEAVA" 203 2021     25 "Canada"
                          "ATG" 16 "PREPARATIONS OF MEAT, OF FISH OR OF CRUSTACEANS, M" 312 2018  11.25 "Canada"
                          "ATG" 16 "PREPARATIONS OF MEAT, OF FISH OR OF CRUSTACEANS, M" 312 2019   13.9 "Canada"
                          "ATG" 16 "PREPARATIONS OF MEAT, OF FISH OR OF CRUSTACEANS, M" 312 2020   13.9 "Canada"
                          "ATG" 16 "PREPARATIONS OF MEAT, OF FISH OR OF CRUSTACEANS, M" 312 2021   13.9 "Canada"
                          "ATG" 17 "SUGARS AND SUGAR CONFECTIONERY"                     206 2018  28.13 "Canada"
                          "ATG" 17 "SUGARS AND SUGAR CONFECTIONERY"                     206 2019     20 "Canada"
                          "ATG" 17 "SUGARS AND SUGAR CONFECTIONERY"                     206 2020     20 "Canada"
                          "ATG" 17 "SUGARS AND SUGAR CONFECTIONERY"                     206 2021     20 "Canada"
                          "ATG" 18 "COCOA AND COCOA PREPARATIONS"                       305 2018     30 "Canada"
                          "ATG" 18 "COCOA AND COCOA PREPARATIONS"                       305 2019     30 "Canada"
                          "ATG" 18 "COCOA AND COCOA PREPARATIONS"                       305 2020     30 "Canada"
                          "ATG" 18 "COCOA AND COCOA PREPARATIONS"                       305 2021     30 "Canada"
                          "ATG" 19 "PREPARATIONS OF CEREALS, FLOUR, STARCH OR MILK; PA" 215 2018  18.33 "Canada"
                          "ATG" 19 "PREPARATIONS OF CEREALS, FLOUR, STARCH OR MILK; PA" 215 2019     20 "Canada"
                          "ATG" 19 "PREPARATIONS OF CEREALS, FLOUR, STARCH OR MILK; PA" 215 2020     20 "Canada"
                          "ATG" 19 "PREPARATIONS OF CEREALS, FLOUR, STARCH OR MILK; PA" 215 2021     20 "Canada"
                          "ATG" 20 "PREPARATIONS OF VEGETABLES, FRUIT, NUTS OR OTHER P" 310 2018  16.33 "Canada"
                          "ATG" 20 "PREPARATIONS OF VEGETABLES, FRUIT, NUTS OR OTHER P" 310 2019   15.8 "Canada"
                          "ATG" 20 "PREPARATIONS OF VEGETABLES, FRUIT, NUTS OR OTHER P" 310 2020   15.8 "Canada"
                          "ATG" 20 "PREPARATIONS OF VEGETABLES, FRUIT, NUTS OR OTHER P" 310 2021   15.8 "Canada"
                          "ATG" 21 "MISCELLANEOUS EDIBLE PREPARATIONS"                  215 2018  18.25 "Canada"
                          "ATG" 21 "MISCELLANEOUS EDIBLE PREPARATIONS"                  215 2019  16.13 "Canada"
                          "ATG" 21 "MISCELLANEOUS EDIBLE PREPARATIONS"                  215 2020  16.13 "Canada"
                          "ATG" 21 "MISCELLANEOUS EDIBLE PREPARATIONS"                  215 2021  16.13 "Canada"
                          "ATG" 22 "BEVERAGES, SPIRITS AND VINEGAR"                     301 2018  24.17 "Canada"
                          "ATG" 22 "BEVERAGES, SPIRITS AND VINEGAR"                     301 2019  22.86 "Canada"
                          "ATG" 22 "BEVERAGES, SPIRITS AND VINEGAR"                     301 2020  22.86 "Canada"
                          "ATG" 22 "BEVERAGES, SPIRITS AND VINEGAR"                     301 2021  22.86 "Canada"
                          "ATG" 23 "RESIDUES AND WASTE FROM THE FOOD INDUSTRIES; PREPA" 202 2018     20 "Canada"
                          "ATG" 23 "RESIDUES AND WASTE FROM THE FOOD INDUSTRIES; PREPA" 202 2019  16.07 "Canada"
                          "ATG" 23 "RESIDUES AND WASTE FROM THE FOOD INDUSTRIES; PREPA" 202 2020  16.07 "Canada"
                          "ATG" 23 "RESIDUES AND WASTE FROM THE FOOD INDUSTRIES; PREPA" 202 2021  16.07 "Canada"
                          "ATG" 24 "TOBACCO AND MANUFACTURED TOBACCO SUBSTITUTES"       314 2018     35 "Canada"
                          "ATG" 24 "TOBACCO AND MANUFACTURED TOBACCO SUBSTITUTES"       314 2019      5 "Canada"
                          "ATG" 24 "TOBACCO AND MANUFACTURED TOBACCO SUBSTITUTES"       314 2020      5 "Canada"
                          "ATG" 24 "TOBACCO AND MANUFACTURED TOBACCO SUBSTITUTES"       314 2021      5 "Canada"
                          "GAB"  2 "MEAT AND EDIBLE MEAT OFFAL"                         304 2019  14.38 "Canada"
                          "GAB" 13 "LAC; GUMS, RESINS AND OTHER VEGETABLE SAPS AND EXT" 214 2019     10 "Canada"
                          end
                          I am always grateful for your help! Thanks.

                          Comment


                          • #28
                            Well, as they stand, these data sets cannot be -merge-d together. The only variables they have in common are importer, exporter, bico, and year. But these four variables still fail to jointly identify unique observations in either data set.

                            It is possible to use -joinby- instead, which would pair up each observation for a given combination of importer, exporter, bico, and year in each data set with every observation in the other data set having the same combination of importer, exporter, bico, and year. I have no idea if that would be a suitable thing to do for your purposes.

                            The using data set observations that have the same importer, exporter, bico, and year all seem to refer to different products, and the combination of importer, exporter, bico, year, and month does uniquely identify observations.. In the master data set they seem to refer to different months, and here importer, exporter, bico, year, and prod_no uniquely identify observations.

                            In the master data set, the names of the other variables suggest that they are totals of things. (I can't make sense of what those things are, but it may not matter.) This suggests it might be sensible to aggregate up (-collapse-) the master data set to single observations per year, adding up the totals. Then importer, exporter, bico, and year would uniquely identify observations. There would be one other step you need to take first to do that: in the using data set exporter is given by country name, whereas importer, as well as importer and exporter in the master data set are given by ISO-3 codes. So you would need to convert those country names to 3 letter codes. If you have only a few exporters, that could be done easily with a few -replace- commands. If you have a lot, then you might use the -kountry- command, available from SSC, to do that.

                            So, something along these lines:
                            Code:
                            use using_data_set, clear
                            // INSERT HERE CODE TO CONVERT country TO ISO-3 CODES
                            tempfile holding
                            save `holding'
                            
                            use master_data_set, clear
                            collapse (sum) tot_*, by(importer exporter bico year)
                            merge 1:m importer exporter bico year using `holding'
                            Again, I have no idea if the resulting data set is what you need, or if it even makes sense. I'm putting a lot of weight on the general appearance of the data sets and the fact that in the master the non-key variables' names all begin with tot_, suggesting they are totals. But see what you think.

                            Comment


                            • #29
                              Hi Clyde, I'll try this and get back to you. Thank you so much.

                              Comment


                              • #30
                                Hi Clyde Schechter You suggested aggregating the totals by year, this would not be good for me as my main independent variables are also monthly. I'm sorry I forgot to include them in the earlier master dataset excerpt. All those total variables are also monthly, they are the dependent variables. I used the code you provided which merged the data but unfortunately collapsed them into a yearly format (as you rightly stated previously) and dropped the monthly independent variables. Do you think there are other ways to go about this please? Basically, the main information I need from the using dataset is the "tariff" variable, and this is only available in a yearly format. I wouldn't mind the tariff value for 2018 for example, repeating all through Jan to Dec of 2018 to match the monthly structure of the master dataset. I want the "bico importer year" combination in the using to match the "bico importer year" combination in the master dataset.

                                Here is another excerpt from the master dataset;

                                Code:
                                * Example generated by -dataex-. For more info, type help dataex
                                clear
                                input str3 exporter str8 importer float year byte month_id float(tot_bico_bval tot_bico_ival tot_bico_hval tot_cropval tot_fbval tot_hortval tot_liveval lncases1_imp lncases1_exp lndeaths1_imp lndeaths1_exp lnstringmax1_imp lnstringmax1_exp)
                                "CAN" "ABW" 2018 10    .     0      .  2115     .      .      .         0         0         0         0         0         0
                                "CAN" "ABW" 2022  6    .     .  26954     .     .  25802      .  10.61445 15.192344  5.402678 10.644305  3.293241  2.986187
                                "CAN" "ABW" 2022  1    . 60160      . 17248     .      .      . 10.404293 14.938378  5.267858 10.430314  3.562749   4.28854
                                "CAN" "ABW" 2019  2    .     . 157142     .     .      .  27502         0         0         0         0         0         0
                                "CAN" "ABW" 2018 12    . 22097      . 17061     .      .      .         0         0         0         0         0         0
                                "CAN" "ABW" 2022  8    . 57043      . 11457     .      .      . 10.665438 15.249378  5.429346  10.69571  3.293241  3.020913
                                "CAN" "ABW" 2022  9    .     .  44567     .     .      .  41122  10.66828 15.269304  5.442418 10.723752  3.293241  3.020425
                                "CAN" "ABW" 2018  5    . 46846      . 67736     .      .      .         0         0         0         0         0         0
                                "CAN" "ABW" 2018  3    .     .  55525     .     .  52708      .         0         0         0         0         0         0
                                "CAN" "ABW" 2021  9    . 48085      .  8508     .      .      .   9.64866 14.303493  5.117994  10.23509  3.875774 4.2612705
                                "CAN" "ABW" 2018  9    .     .  48610     .     .  21773      .         0         0         0         0         0         0
                                "CAN" "ABW" 2021  6    .     .  99865     .     .      .  71848  9.318208  14.16599 4.6821313  10.17721  3.894877 4.3122745
                                "CAN" "ABW" 2020  9    .  3072      .  5869     .      .      .  8.285008  11.99881 3.3322046  9.142489   4.30609  4.193888
                                "CAN" "ABW" 2021 10    .     0      .     0     .      .      .  9.675708 14.357932  5.147494  10.27405  3.562749 4.1890483
                                "CAN" "ABW" 2019  8    .     . 198874     .     . 152175      .         0         0         0         0         0         0
                                "CAN" "ABW" 2021  1    .     .  13117     .     .      0      .   8.84894 13.570777 4.0943446  9.905186  3.894877 4.3367677
                                "CAN" "ABW" 2019  9    .     .  81589     .     .      .  29008         0         0         0         0         0         0
                                "CAN" "ABW" 2020  2 1732     .      . 56961     .      .      .         0 3.5263605         .         0         .  1.329724
                                "CAN" "ABW" 2020  3    . 11121      . 13867     .      .      . 4.0253515 9.2791195         .  5.030438 4.4565544  4.324662
                                "CAN" "ABW" 2021  2    .     0      .     .  4516      .      .  8.973605 13.676275  4.304065  9.998616  4.051437 4.3367677
                                "CAN" "ABW" 2022  4    .     . 331086     .     .      . 305778 10.458722 15.141302  5.605802 10.578115  3.293241 3.6117284
                                "CAN" "ABW" 2021 12    .     0      .  5146     .      .      .  9.926325   14.6147  5.204007 10.319596  3.562749  4.241183
                                "CAN" "ABW" 2021  8    .     .  41197     .     .  24791      .    9.5872 14.223826  4.990433 10.201145 3.9498966 4.2354097
                                "CAN" "ABW" 2021  7    .     .  16914     .     .      .      0   9.36999 14.176653 4.7095304 10.188666 3.5360196 4.2614117
                                "CAN" "ABW" 2021  5    .     .  19238     .     .      0      .  9.304377  14.14272 4.6821313 10.148354 4.1139836 4.3367677
                                "CAN" "ABW" 2019 10    . 67881      . 72342     .      .      .         0         0         0         0         0         0
                                "CAN" "ABW" 2020 11    .  5109      . 11246     .      .      . 8.4859085 12.857014 3.8286414  9.411157  3.875774  4.299867
                                "CAN" "ABW" 2022 11    . 42912      .  8946     .      .      . 10.683775 15.304458   5.46806 10.779018  3.293241 1.8809906
                                "CAN" "ABW" 2020  5    .     .  76380     .     .      .  36816  4.624973 11.430283 1.3862944 8.9655905 4.4565544  4.324662
                                "CAN" "ABW" 2019 11    .     . 554245     .     .      . 143141         0         0         0         0         0         0
                                "CAN" "ABW" 2022  3    .  4018      . 42625     .      .      . 10.433145 15.065387  5.361292 10.534706  3.391147 3.8161726
                                "CAN" "ABW" 2020  4    .     .  51669     .     .      .  28008 4.6151204 10.954572 1.0986123  8.307953 4.4985867 4.3488574
                                "CAN" "ABW" 2022  5    .     .  41434     .  4467      .      .  10.51962 15.172418  5.365976 10.621815  3.293241  3.109507
                                "CAN" "ABW" 2020  6    .     .   3148     .     .      .      0  4.644391 11.557985 1.3862944  9.073718 4.0674872  4.274302
                                "CAN" "ABW" 2020  8    .     . 174394 31457     .      .      .  7.604396  11.77217  2.397895   9.12129   4.30609 4.2214174
                                "CAN" "ABW" 2019  6    .     . 144260     .     . 137028      .         0         0         0         0         0         0
                                "CAN" "ABW" 2021 11    .     0      .     0     .      .      .  9.702289 14.402294  5.164786 10.298532  3.562749  4.241327
                                "CAN" "ABW" 2019  7    . 43981      .     .     .      .  35876         0         0         0         0         0         0
                                "CAN" "ABW" 2019 12    0     .      .  4126     .      .      .         0         0         0         0         0         0
                                "CAN" "ABW" 2020  7    . 30307      . 57233     .      .      .  4.804021 11.668962 1.3862944  9.102978  3.875774 4.2482095
                                "CAN" "ABW" 2018  2    .     0      .  9021     .      .      .         0         0         0         0         0         0
                                "CAN" "ABW" 2021  4    .     .      0     .     .      0      .  9.272282 14.022956 4.6051702 10.094975 4.2281466 4.3367677
                                "CAN" "ABW" 2019  4    .     . 110589 19158     .      .      .         0         0         0         0         0         0
                                "CAN" "ABW" 2020  1    .     . 168011     .     .      .   6769         0  1.609438         .         0         .  1.329724
                                "CAN" "ABW" 2020 10    . 23946      . 28033     .      .      .  8.414939 12.379375 3.6635616  9.232786  4.083115  4.299867
                                "CAN" "ABW" 2019  1    .     . 168430     .     .      .   7240         0         0         0         0         0         0
                                "CAN" "ABW" 2020 12    .     .  66235     .     .  61064      .  8.610683 13.288301  3.912023   9.66377  3.686126  4.299867
                                "CAN" "ABW" 2019  3 1591     .      .     . 24195      .      .         0         0         0         0         0         0
                                "CAN" "ABW" 2018  6    . 25002      .  3875     .      .      .         0         0         0         0         0         0
                                "CAN" "ABW" 2018  4    .     . 115813     .     .  92004      .         0         0         0         0         0         0
                                "CAN" "ABW" 2022 12    .     0      .     0     .      .      . 10.686316  15.32073  5.638355 10.804441  3.293241 1.8809906
                                "CAN" "ABW" 2022 10    .     . 148568     .     . 121474      . 10.695257  15.29001  5.451038 10.750964  3.293241 2.2332351
                                "CAN" "ABW" 2018  8    .     . 142762     .     .      .  25507         0         0         0         0         0         0
                                "CAN" "ABW" 2018  1    . 18613      . 26541     .      .      .         0         0         0         0         0         0
                                "CAN" "ABW" 2022  7    . 20642      . 20642     .      .      .  10.64735  15.22472  5.416101 10.667838  3.293241    3.0214
                                "CAN" "ABW" 2021  3    .     .  52055     .  7959      .      .  9.153135  13.80613  4.465908 10.041553 4.2281466 4.3367677
                                "CAN" "ABW" 2022  2    0     .      .     0     .      .      . 10.424808  15.01016  5.356586 10.507667 3.4518905  4.286341
                                "CAN" "ABW" 2019  5    .     0      .  3725     .      .      .         0         0         0         0         0         0
                                "CAN" "ABW" 2018  7    .     . 206071 61569     .      .      .         0         0         0         0         0         0
                                "CAN" "ABW" 2018 11    .     . 340166     .     .      .  54216         0         0         0         0         0         0
                                "CAN" "AFG" 2018  6    0     .      .     0     .      .      .         0         0         0         0         0         0
                                "CAN" "AFG" 2022  5    .     .      0     .     .      .      0 12.102644 15.172418  8.949755 10.621815 2.8718684  3.109507
                                "CAN" "AFG" 2019 11    0     .      .     0     .      .      .         0         0         0         0         0         0
                                "CAN" "AFG" 2019  4    .     0      .     .     .      .      0         0         0         0         0         0         0
                                "CAN" "AFG" 2020  8    .  9090      .     .     .      .   9090 10.551872  11.77217  7.249215   9.12129 4.3782697 4.2214174
                                "CAN" "AFG" 2018 12    .     .   7844     . 18901      .      .         0         0         0         0         0         0
                                "CAN" "AFG" 2019  7    .     .      0     .     .      .      0         0         0         0         0         0         0
                                "CAN" "AFG" 2021 12    .     .      0     .     .      .      0 11.970888   14.6147  8.903407 10.319596  3.359681  4.241183
                                "CAN" "AFG" 2018 10    .     .      0     .     0      .      .         0         0         0         0         0         0
                                "CAN" "AFG" 2022  1    .     .      0     .     .      .      0 12.001058 14.938378  8.911261 10.430314  3.017494   4.28854
                                "CAN" "AFG" 2019  2    .     .  29949     .   200      .      .         0         0         0         0         0         0
                                "CAN" "AFG" 2021  9    .     .      0     .     .      .      0  11.95231 14.303493   8.88253  10.23509  3.774828 4.2612705
                                "CAN" "AFG" 2019  5    .     0      .     0     .      .      .         0         0         0         0         0         0
                                "CAN" "AFG" 2020  2    .     .      0     .     .      .      0 1.7917595 3.5263605         .         0 2.2332351  1.329724
                                "CAN" "AFG" 2020  1    .     0      .     .     .      .      0         0  1.609438         .         0         .  1.329724
                                "CAN" "AFG" 2021  3    .     .      0     .     .      .      0   10.9412  13.80613  7.818028 10.041553 3.4518905 4.3367677
                                "CAN" "AFG" 2019 10    .     .      0     .     .      .      0         0         0         0         0         0         0
                                "CAN" "AFG" 2018  2    0     .      .     .     0      .      .         0         0         0         0         0         0
                                "CAN" "AFG" 2020  5    . 99089      .     .     .      . 153132    9.6278 11.430283  5.541264 8.9655905 4.4457054  4.324662
                                "CAN" "AFG" 2022  4    .     .      0     .     .      .      0  12.09447 15.141302  8.946896 10.578115 2.8718684 3.6117284
                                "CAN" "AFG" 2018 11    .     0      .     0     .      .      .         0         0         0         0         0         0
                                "CAN" "AFG" 2021 11    .     .      0     .     .      .      0 11.965846 14.402294  8.896862 10.298532  3.359681  4.241327
                                "CAN" "AFG" 2022 10    .     .      0     .     .      .      0 12.221276  15.29001  8.964824 10.750964 1.8809906 2.2332351
                                "CAN" "AFG" 2019  3    .     . 147507     .     .      . 147407         0         0         0         0         0         0
                                "CAN" "AFG" 2018  8    .     .      0     .     0      .      .         0         0         0         0         0         0
                                "CAN" "AFG" 2020  3    .     .      0     .     .      .      0  5.117994 9.2791195  1.609438  5.030438 4.2281466  4.324662
                                "CAN" "AFG" 2021  6    .     . 253528     .     .      . 253528 11.684017  14.16599   8.49126  10.17721   3.85651 4.3122745
                                "CAN" "AFG" 2020  9    .     . 270350     .     .      . 270350 10.580379  11.99881  7.288244  9.142489  3.391147  4.193888
                                "CAN" "AFG" 2021 10    .     .      0     .     .      .      0  11.95922 14.357932 8.8930235  10.27405  3.686126 4.1890483
                                "CAN" "AFG" 2020  4    .     . 108766     .     .      . 108766  7.510978 10.954572 4.1108737  8.307953 4.4457054 4.3488574
                                "CAN" "AFG" 2019 12    .     .      0     .     .      .  79072         0         0         0         0         0         0
                                "CAN" "AFG" 2021  7    .     .      0     .     .      .      0 11.899241 14.176653  8.811205 10.188666  4.043402 4.2614117
                                "CAN" "AFG" 2019  9    .     .      0     .     .      .      0         0         0         0         0         0         0
                                "CAN" "AFG" 2020 11    .     0      .     .     .      .  82987  10.74108 12.857014  7.475339  9.411157 2.5680215  4.299867
                                "CAN" "AFG" 2019  8    .     0      .     .     .      .      0         0         0         0         0         0         0
                                "CAN" "AFG" 2020  6    .     0      .     .     .      .      0 10.356027 11.557985   6.60665  9.073718 4.4457054  4.274302
                                "CAN" "AFG" 2021  5    .     .      0     .     .      .      0 11.182182  14.14272  7.987864 10.148354 4.0187225 4.3367677
                                "CAN" "AFG" 2022  6    .     .      0     .     .      .      0 12.114664 15.192344  8.952087 10.644305 2.4940314  2.986187
                                "CAN" "AFG" 2018  9    .     . 102375     .     1      .      .         0         0         0         0         0         0
                                "CAN" "AFG" 2022  9    .     .      0     .     .      .      0  12.20201 15.269304 8.9620075 10.723752 2.4940314  3.020425
                                end
                                And the using:

                                Code:
                                * Example generated by -dataex-. For more info, type help dataex
                                clear
                                input str6 exporter str3 importer int(bico year) byte prod_no double tariff str50 prod_name
                                "CAN" "CYM" 201 2021  3      0 "FISH AND CRUSTACEANS, MOLLUSCS AND OTHER AQUATIC I"
                                "CAN" "CYM" 306 2021  6     12 "LIVE TREES AND OTHER PLANTS; BULBS, ROOTS AND THE "
                                "CAN" "CYM" 213 2021  7   5.67 "EDIBLE VEGETABLES AND CERTAIN ROOTS AND TUBERS"    
                                "CAN" "CYM" 313 2021  8     22 "EDIBLE FRUIT AND NUTS; PEEL OF CITRUS FRUIT OR MEL"
                                "CAN" "CYM" 217 2021  9   3.67 "COFFEE, TEA, MATÉ AND SPICES"                     
                                "CAN" "CYM" 101 2021 10      0 "CEREALS"                                           
                                "CAN" "CYM" 204 2021 11     22 "PRODUCTS OF THE MILLING INDUSTRY; MALT; STARCHES; "
                                "CAN" "CYM" 102 2021 12      0 "OIL SEEDS AND OLEAGINOUS FRUITS; MISCELLANEOUS GRA"
                                "CAN" "CYM" 203 2021 15     22 "ANIMAL OR VEGETABLE FATS AND OILS AND THEIR CLEAVA"
                                "CAN" "CYM" 312 2021 16     22 "PREPARATIONS OF MEAT, OF FISH OR OF CRUSTACEANS, M"
                                "CAN" "CYM" 206 2021 17     11 "SUGARS AND SUGAR CONFECTIONERY"                    
                                "CAN" "CYM" 215 2021 19  18.33 "PREPARATIONS OF CEREALS, FLOUR, STARCH OR MILK; PA"
                                "CAN" "CYM" 310 2021 20     22 "PREPARATIONS OF VEGETABLES, FRUIT, NUTS OR OTHER P"
                                "CAN" "CYM" 215 2021 21  14.67 "MISCELLANEOUS EDIBLE PREPARATIONS"                 
                                "CAN" "CYM" 301 2021 22 162.82 "BEVERAGES, SPIRITS AND VINEGAR"                    
                                "CAN" "CYM" 202 2021 23     11 "RESIDUES AND WASTE FROM THE FOOD INDUSTRIES; PREPA"
                                "CAN" "CYM" 314 2021 24    102 "TOBACCO AND MANUFACTURED TOBACCO SUBSTITUTES"      
                                "CAN" "ATG" 304 2018  2  20.42 "MEAT AND EDIBLE MEAT OFFAL"                        
                                "CAN" "ATG" 304 2019  2  20.28 "MEAT AND EDIBLE MEAT OFFAL"                        
                                "CAN" "ATG" 304 2020  2  20.28 "MEAT AND EDIBLE MEAT OFFAL"                        
                                "CAN" "ATG" 304 2021  2  20.28 "MEAT AND EDIBLE MEAT OFFAL"                        
                                "CAN" "ATG" 201 2018  3  13.65 "FISH AND CRUSTACEANS, MOLLUSCS AND OTHER AQUATIC I"
                                "CAN" "ATG" 201 2019  3   6.33 "FISH AND CRUSTACEANS, MOLLUSCS AND OTHER AQUATIC I"
                                "CAN" "ATG" 201 2020  3   6.33 "FISH AND CRUSTACEANS, MOLLUSCS AND OTHER AQUATIC I"
                                "CAN" "ATG" 201 2021  3   6.33 "FISH AND CRUSTACEANS, MOLLUSCS AND OTHER AQUATIC I"
                                "CAN" "ATG" 212 2018  4  13.33 "DAIRY PRODUCE; BIRDS' EGGS; NATURAL HONEY; EDIBLE "
                                "CAN" "ATG" 212 2019  4   1.67 "DAIRY PRODUCE; BIRDS' EGGS; NATURAL HONEY; EDIBLE "
                                "CAN" "ATG" 212 2020  4   1.67 "DAIRY PRODUCE; BIRDS' EGGS; NATURAL HONEY; EDIBLE "
                                "CAN" "ATG" 212 2021  4   1.67 "DAIRY PRODUCE; BIRDS' EGGS; NATURAL HONEY; EDIBLE "
                                "CAN" "ATG" 306 2018  6     40 "LIVE TREES AND OTHER PLANTS; BULBS, ROOTS AND THE "
                                "CAN" "ATG" 306 2019  6  17.33 "LIVE TREES AND OTHER PLANTS; BULBS, ROOTS AND THE "
                                "CAN" "ATG" 306 2020  6  17.33 "LIVE TREES AND OTHER PLANTS; BULBS, ROOTS AND THE "
                                "CAN" "ATG" 306 2021  6  17.33 "LIVE TREES AND OTHER PLANTS; BULBS, ROOTS AND THE "
                                "CAN" "ATG" 213 2018  7  22.42 "EDIBLE VEGETABLES AND CERTAIN ROOTS AND TUBERS"    
                                "CAN" "ATG" 213 2019  7   23.5 "EDIBLE VEGETABLES AND CERTAIN ROOTS AND TUBERS"    
                                "CAN" "ATG" 213 2020  7   23.5 "EDIBLE VEGETABLES AND CERTAIN ROOTS AND TUBERS"    
                                "CAN" "ATG" 213 2021  7   23.5 "EDIBLE VEGETABLES AND CERTAIN ROOTS AND TUBERS"    
                                "CAN" "ATG" 313 2018  8     28 "EDIBLE FRUIT AND NUTS; PEEL OF CITRUS FRUIT OR MEL"
                                "CAN" "ATG" 313 2019  8  35.28 "EDIBLE FRUIT AND NUTS; PEEL OF CITRUS FRUIT OR MEL"
                                "CAN" "ATG" 313 2020  8  35.28 "EDIBLE FRUIT AND NUTS; PEEL OF CITRUS FRUIT OR MEL"
                                "CAN" "ATG" 313 2021  8  35.28 "EDIBLE FRUIT AND NUTS; PEEL OF CITRUS FRUIT OR MEL"
                                "CAN" "ATG" 217 2018  9  16.67 "COFFEE, TEA, MATÉ AND SPICES"                     
                                "CAN" "ATG" 217 2019  9   22.5 "COFFEE, TEA, MATÉ AND SPICES"                     
                                "CAN" "ATG" 217 2020  9   22.5 "COFFEE, TEA, MATÉ AND SPICES"                     
                                "CAN" "ATG" 217 2021  9   22.5 "COFFEE, TEA, MATÉ AND SPICES"                     
                                "CAN" "ATG" 101 2018 10      5 "CEREALS"                                           
                                "CAN" "ATG" 101 2019 10   12.5 "CEREALS"                                           
                                "CAN" "ATG" 101 2020 10   12.5 "CEREALS"                                           
                                "CAN" "ATG" 101 2021 10   12.5 "CEREALS"                                           
                                "CAN" "ATG" 204 2018 11   6.67 "PRODUCTS OF THE MILLING INDUSTRY; MALT; STARCHES; "
                                "CAN" "ATG" 204 2019 11    7.5 "PRODUCTS OF THE MILLING INDUSTRY; MALT; STARCHES; "
                                "CAN" "ATG" 204 2020 11    7.5 "PRODUCTS OF THE MILLING INDUSTRY; MALT; STARCHES; "
                                "CAN" "ATG" 204 2021 11    7.5 "PRODUCTS OF THE MILLING INDUSTRY; MALT; STARCHES; "
                                "CAN" "ATG" 102 2018 12   1.16 "OIL SEEDS AND OLEAGINOUS FRUITS; MISCELLANEOUS GRA"
                                "CAN" "ATG" 102 2019 12   1.25 "OIL SEEDS AND OLEAGINOUS FRUITS; MISCELLANEOUS GRA"
                                "CAN" "ATG" 102 2020 12   1.25 "OIL SEEDS AND OLEAGINOUS FRUITS; MISCELLANEOUS GRA"
                                "CAN" "ATG" 102 2021 12   1.25 "OIL SEEDS AND OLEAGINOUS FRUITS; MISCELLANEOUS GRA"
                                "CAN" "ATG" 214 2018 13   12.5 "LAC; GUMS, RESINS AND OTHER VEGETABLE SAPS AND EXT"
                                "CAN" "ATG" 203 2018 15   23.5 "ANIMAL OR VEGETABLE FATS AND OILS AND THEIR CLEAVA"
                                "CAN" "ATG" 203 2019 15     25 "ANIMAL OR VEGETABLE FATS AND OILS AND THEIR CLEAVA"
                                "CAN" "ATG" 203 2020 15     25 "ANIMAL OR VEGETABLE FATS AND OILS AND THEIR CLEAVA"
                                "CAN" "ATG" 203 2021 15     25 "ANIMAL OR VEGETABLE FATS AND OILS AND THEIR CLEAVA"
                                "CAN" "ATG" 312 2018 16  11.25 "PREPARATIONS OF MEAT, OF FISH OR OF CRUSTACEANS, M"
                                "CAN" "ATG" 312 2019 16   13.9 "PREPARATIONS OF MEAT, OF FISH OR OF CRUSTACEANS, M"
                                "CAN" "ATG" 312 2020 16   13.9 "PREPARATIONS OF MEAT, OF FISH OR OF CRUSTACEANS, M"
                                "CAN" "ATG" 312 2021 16   13.9 "PREPARATIONS OF MEAT, OF FISH OR OF CRUSTACEANS, M"
                                "CAN" "ATG" 206 2018 17  28.13 "SUGARS AND SUGAR CONFECTIONERY"                    
                                "CAN" "ATG" 206 2019 17     20 "SUGARS AND SUGAR CONFECTIONERY"                    
                                "CAN" "ATG" 206 2020 17     20 "SUGARS AND SUGAR CONFECTIONERY"                    
                                "CAN" "ATG" 206 2021 17     20 "SUGARS AND SUGAR CONFECTIONERY"                    
                                "CAN" "ATG" 305 2018 18     30 "COCOA AND COCOA PREPARATIONS"                      
                                "CAN" "ATG" 305 2019 18     30 "COCOA AND COCOA PREPARATIONS"                      
                                "CAN" "ATG" 305 2020 18     30 "COCOA AND COCOA PREPARATIONS"                      
                                "CAN" "ATG" 305 2021 18     30 "COCOA AND COCOA PREPARATIONS"                      
                                "CAN" "ATG" 215 2018 19  18.33 "PREPARATIONS OF CEREALS, FLOUR, STARCH OR MILK; PA"
                                "CAN" "ATG" 215 2019 19     20 "PREPARATIONS OF CEREALS, FLOUR, STARCH OR MILK; PA"
                                "CAN" "ATG" 215 2020 19     20 "PREPARATIONS OF CEREALS, FLOUR, STARCH OR MILK; PA"
                                "CAN" "ATG" 215 2021 19     20 "PREPARATIONS OF CEREALS, FLOUR, STARCH OR MILK; PA"
                                "CAN" "ATG" 310 2018 20  16.33 "PREPARATIONS OF VEGETABLES, FRUIT, NUTS OR OTHER P"
                                "CAN" "ATG" 310 2019 20   15.8 "PREPARATIONS OF VEGETABLES, FRUIT, NUTS OR OTHER P"
                                "CAN" "ATG" 310 2020 20   15.8 "PREPARATIONS OF VEGETABLES, FRUIT, NUTS OR OTHER P"
                                "CAN" "ATG" 310 2021 20   15.8 "PREPARATIONS OF VEGETABLES, FRUIT, NUTS OR OTHER P"
                                "CAN" "ATG" 215 2018 21  18.25 "MISCELLANEOUS EDIBLE PREPARATIONS"                 
                                "CAN" "ATG" 215 2019 21  16.13 "MISCELLANEOUS EDIBLE PREPARATIONS"                 
                                "CAN" "ATG" 215 2020 21  16.13 "MISCELLANEOUS EDIBLE PREPARATIONS"                 
                                "CAN" "ATG" 215 2021 21  16.13 "MISCELLANEOUS EDIBLE PREPARATIONS"                 
                                "CAN" "ATG" 301 2018 22  24.17 "BEVERAGES, SPIRITS AND VINEGAR"                    
                                "CAN" "ATG" 301 2019 22  22.86 "BEVERAGES, SPIRITS AND VINEGAR"                    
                                "CAN" "ATG" 301 2020 22  22.86 "BEVERAGES, SPIRITS AND VINEGAR"                    
                                "CAN" "ATG" 301 2021 22  22.86 "BEVERAGES, SPIRITS AND VINEGAR"                    
                                "CAN" "ATG" 202 2018 23     20 "RESIDUES AND WASTE FROM THE FOOD INDUSTRIES; PREPA"
                                "CAN" "ATG" 202 2019 23  16.07 "RESIDUES AND WASTE FROM THE FOOD INDUSTRIES; PREPA"
                                "CAN" "ATG" 202 2020 23  16.07 "RESIDUES AND WASTE FROM THE FOOD INDUSTRIES; PREPA"
                                "CAN" "ATG" 202 2021 23  16.07 "RESIDUES AND WASTE FROM THE FOOD INDUSTRIES; PREPA"
                                "CAN" "ATG" 314 2018 24     35 "TOBACCO AND MANUFACTURED TOBACCO SUBSTITUTES"      
                                "CAN" "ATG" 314 2019 24      5 "TOBACCO AND MANUFACTURED TOBACCO SUBSTITUTES"      
                                "CAN" "ATG" 314 2020 24      5 "TOBACCO AND MANUFACTURED TOBACCO SUBSTITUTES"      
                                "CAN" "ATG" 314 2021 24      5 "TOBACCO AND MANUFACTURED TOBACCO SUBSTITUTES"      
                                "CAN" "GAB" 304 2019  2  14.38 "MEAT AND EDIBLE MEAT OFFAL"                        
                                "CAN" "GAB" 214 2019 13     10 "LAC; GUMS, RESINS AND OTHER VEGETABLE SAPS AND EXT"
                                end

                                Thank you very much for your patience and understanding.

                                Comment

                                Working...
                                X