Announcement

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

  • Merge

    Dear all,

    My apologies for another post. I am trying to merge (again) two different datasets. One is an industry level dataset and the other is a country level dataset. I tried applying the following using the industry level dataset as master


    merge m:1 country1 year using country level dataset. (But I get that these country1 year do not uniquely describe the using dataset). I check for duplicates but have no duplicates in either datasets. Thanks!

    Code:
     * Example generated by -dataex-. To install: ssc install dataex (industry level dataset by country year)
    clear
    input float country1 int year str2 isic str3 isiccomb byte sourcecode long(Establishments Employment) double(Wages OutputINDSTAT4 ValueAdded GrossFixed) long FemaleEmployees str16 value51
    4 1973 "16" "16"  3 .     0 . . . . . ""
    4 1973 "32" "31A" 3 .     . . . . . . ""
    4 1973 "35" "34A" 3 .     . . . . . . ""
    4 1973 "28" "28"  3 .     0 . . . . . ""
    4 1973 "26" "26"  3 .  1295 . . . . . ""
    4 1973 "37" "37"  0 .     . . . . . . ""
    4 1973 "36" "20C" 3 .     . . . . . . ""
    4 1973 "25" "25"  3 .   360 . . . . . ""
    4 1973 "24" "24"  3 .   259 . . . . . ""
    4 1973 "21" "21"  3 .     0 . . . . . ""
    4 1973 "20" "20C" 3 .  1941 . . . . . ""
    4 1973 "17" "17"  3 . 12555 . . . . . ""
    4 1973 "34" "34A" 3 .     0 . . . . . ""
    4 1973 "22" "22"  3 .  1287 . . . . . ""
    4 1973 "29" "29C" 3 .     0 . . . . . ""
    4 1973 "15" "15"  3 .  4321 . . . . . ""
    4 1973 "31" "31A" 3 .     0 . . . . . ""
    4 1973 "18" "18A" 3 .   725 . . . . . ""
    4 1973 "23" "23"  3 .     0 . . . . . ""
    4 1973 "27" "27"  3 .     0 . . . . . ""
    4 1973 "19" "18A" 3 .     . . . . . . ""
    4 1973 "30" "29C" 3 .     . . . . . . ""
    4 1973 "33" "33"  3 .     0 . . . . . ""
    4 1974 "19" "18A" 3 .     . . . . . . ""
    4 1974 "23" "23"  3 .     0 . . . . . ""
    4 1974 "25" "25"  3 .   427 . . . . . ""
    4 1974 "31" "31A" 3 .     0 . . . . . ""
    4 1974 "34" "34A" 3 .     0 . . . . . ""
    4 1974 "21" "21"  3 .     0 . . . . . ""
    4 1974 "27" "27"  3 .     0 . . . . . ""
    4 1974 "32" "31A" 3 .     . . . . . . ""
    4 1974 "33" "33"  3 .     0 . . . . . ""
    4 1974 "17" "17"  3 . 14243 . . . . . ""
    4 1974 "24" "24"  3 .  3281 . . . . . ""
    4 1974 "36" "20C" 3 .     . . . . . . ""
    4 1974 "15" "15"  3 .  4845 . . . . . ""
    4 1974 "16" "16"  3 .     0 . . . . . ""
    4 1974 "29" "29C" 3 .     0 . . . . . ""
    4 1974 "22" "22"  3 .  1326 . . . . . ""
    4 1974 "37" "37"  0 .     . . . . . . ""
    4 1974 "28" "28"  3 .     0 . . . . . ""
    4 1974 "30" "29C" 3 .     . . . . . . ""
    4 1974 "18" "18A" 3 .   720 . . . . . ""
    4 1974 "35" "34A" 3 .     . . . . . . ""
    4 1974 "26" "26"  3 .  1235 . . . . . ""
    4 1974 "20" "20C" 3 .  2044 . . . . . ""
    4 1975 "16" "16"  3 .     0 . . . . . ""
    4 1975 "23" "23"  3 .     0 . . . . . ""
    4 1975 "18" "18A" 3 .   874 . . . . . ""
    4 1975 "15" "15"  3 .  5103 . . . . . ""
    4 1975 "28" "28"  3 .     0 . . . . . ""
    4 1975 "25" "25"  3 .   507 . . . . . ""
    4 1975 "17" "17"  3 . 17202 . . . . . ""
    4 1975 "31" "31A" 3 .     0 . . . . . ""
    4 1975 "22" "22"  3 .  1447 . . . . . ""
    4 1975 "34" "34A" 3 .     0 . . . . . ""
    4 1975 "30" "29C" 3 .     . . . . . . ""
    4 1975 "37" "37"  0 .     . . . . . . ""
    4 1975 "32" "31A" 3 .     . . . . . . ""
    4 1975 "21" "21"  3 .     0 . . . . . ""
    4 1975 "36" "20C" 3 .     . . . . . . ""
    4 1975 "26" "26"  3 .  1646 . . . . . ""
    4 1975 "29" "29C" 3 .     0 . . . . . ""
    4 1975 "19" "18A" 3 .     . . . . . . ""
    4 1975 "24" "24"  3 .  4046 . . . . . ""
    4 1975 "20" "20C" 3 .  2321 . . . . . ""
    4 1975 "27" "27"  3 .     0 . . . . . ""
    4 1975 "33" "33"  3 .     0 . . . . . ""
    4 1975 "35" "34A" 3 .     . . . . . . ""
    4 1976 "19" "18A" 3 .     . . . . . . ""
    4 1976 "26" "26"  3 .  1335 . . . . . ""
    4 1976 "35" "34A" 3 .     . . . . . . ""
    4 1976 "36" "20C" 3 .     . . . . . . ""
    4 1976 "25" "25"  3 .   583 . . . . . ""
    4 1976 "28" "28"  3 .     0 . . . . . ""
    4 1976 "33" "33"  3 .     0 . . . . . ""
    4 1976 "29" "29C" 3 .     0 . . . . . ""
    4 1976 "23" "23"  3 .     0 . . . . . ""
    4 1976 "30" "29C" 3 .     . . . . . . ""
    4 1976 "31" "31A" 3 .     0 . . . . . ""
    4 1976 "34" "34A" 3 .     0 . . . . . ""
    4 1976 "37" "37"  0 .     . . . . . . ""
    4 1976 "18" "18A" 3 .   840 . . . . . ""
    4 1976 "21" "21"  3 .     0 . . . . . ""
    4 1976 "22" "22"  3 .  1465 . . . . . ""
    4 1976 "15" "15"  3 .  4540 . . . . . ""
    4 1976 "27" "27"  3 .     0 . . . . . ""
    4 1976 "20" "20C" 3 .  2317 . . . . . ""
    4 1976 "32" "31A" 3 .     . . . . . . ""
    4 1976 "17" "17"  3 . 20520 . . . . . ""
    4 1976 "24" "24"  3 .  4479 . . . . . ""
    4 1976 "16" "16"  3 .     0 . . . . . ""
    4 1977 "26" "26"  3 .  1416 . . . . . ""
    4 1977 "32" "31A" 3 .     . . . . . . ""
    4 1977 "30" "29C" 3 .     . . . . . . ""
    4 1977 "37" "37"  0 .     . . . . . . ""
    4 1977 "29" "29C" 3 .     0 . . . . . ""
    4 1977 "23" "23"  3 .     0 . . . . . ""
    4 1977 "25" "25"  3 .   623 . . . . . ""
    4 1977 "31" "31A" 3 .     0 . . . . . ""
    end
    Code:
     * Example generated by -dataex-. To install: ssc install dataex (country level dataset by year)
    clear
    input float country1 int year float(rgdpe rgdpo) double pop float emp double avh float(hc ccon cda cgdpe cgdpo cn rgdpna rconna rwtfpna)
     8 1963         .         .                  .         . .         .         .         .         .         .         .         .         . .
     8 1964         .         .                  .         . .         .         .         .         .         .         .         .         . .
     8 1965         .         .                  .         . .         .         .         .         .         .         .         .         . .
     8 1966         .         .                  .         . .         .         .         .         .         .         .         .         . .
     8 1967         .         .                  .         . .         .         .         .         .         .         .         .         . .
     8 1968         .         .                  .         . .         .         .         .         .         .         .         .         . .
     8 1969         .         .                  .         . .         .         .         .         .         .         .         .         . .
     8 1970  6681.829  6697.492 2.1507069999999997  .7691572 .  1.558792  5366.763  6417.883  6205.434  6225.113  24195.67  9084.574  5694.857 .
     8 1971  6950.334  6958.496 2.2021889999999997  .7931207 . 1.5867927   5557.97  6663.237    6442.9  6456.324   25478.5  9448.031  5923.694 .
     8 1972  7230.394  7246.038           2.254056  .8174835 . 1.6152965  5755.311   6911.02  6683.206  6704.356  26841.97  9827.267  6161.525 .
     8 1973  7518.899  7536.605 2.3062899999999997  .8422419 . 1.6443123  5942.056  7154.137  6916.071  6939.365  28242.49 10222.117  6405.734 .
     8 1974  7821.088  7855.124 2.3588459999999998   .867382 . 1.6738492  6187.133  7488.473  7241.639  7271.993 29784.926     10628  6666.873 .
     8 1975  8136.811  8164.371 2.4117319999999998  .8929093 . 1.7039168  6405.759  7800.153  7545.456  7567.767  31313.83 11058.776  6933.853 .
     8 1976  8450.694  8459.786 2.4649829999999997  .9188393 .  1.739009  6645.872  8088.441  7811.704  7818.528  32858.25 11504.435  7197.978 .
     8 1977  8808.268  8818.585           2.518685  .9452071 . 1.7734824  6968.478 8421.1875  8151.575  8156.313  34542.08 11944.952   7515.88 .
     8 1978  9165.298  9209.292            2.57285  .9720206 .  1.808639    7217.2  8740.171   8462.89  8501.086  36206.11 12458.786  7800.704 .
     8 1979  9463.035 9454.9375 2.6275049999999998  .9992935 . 1.8444928  7447.752  9088.145  8734.917  8729.451 38115.273 12952.166  8052.092 .
     8 1980  9974.774  9964.962            2.68269  1.027045 . 1.8810573  7980.792  9521.948  9280.454  9260.685  39936.04  13370.69  8554.962 .
     8 1981  10320.93  10363.25 2.7370259999999997  1.063231 . 1.9506222  8146.265  9927.992  9621.704  9632.572  42014.68 14138.914  8721.659 .
     8 1982 10414.697 10391.983           2.790275 1.1124681 .   2.02276    8295.9 10357.486  9739.414  9687.837  44387.79  14555.82  8855.192 .
     8 1983 10800.652  10741.69           2.844871 1.1442642 . 2.0975652  8761.843 10597.802  10090.51  10018.06  46400.07 14716.654  9339.651 .
     8 1984 10967.808 10857.104            2.90414 1.1691139 .  2.175137  9059.644 10643.997 10201.584  10085.03  48571.45  14532.46  9676.602 .
     8 1985  11049.23  10957.04 2.9696719999999996 1.1883471 . 2.2555776  9141.163 10841.975 10303.645 10212.863  50552.81  14791.23  9730.233 .
     8 1986  11681.79   11511.3           3.044212 1.2340144 .   2.30544   9586.23  11319.95  10908.19 10697.527  52593.05 15618.756 10166.366 .
     8 1987 11882.934 11730.335           3.124894  1.279103 . 2.3564048  9983.435 11502.114  11090.64 10873.812  54594.54  15495.66 10583.836 .
     8 1988  11635.43 11490.504           3.200977  1.306872 .  2.408496  9944.112 11495.508  10877.66 10672.263  56584.94 15275.526 10519.218 .
     8 1989 12516.765  12432.41 3.2579249999999997  1.329744 .  2.461739  10540.43 12339.514  11729.66 11567.515  58894.53 16778.729  11084.63 .
     8 1990 12005.757  12096.72           3.286073 1.3240782 .  2.516159 11427.937 12632.153  11357.34 11354.654   61056.9 15105.708   11854.1 .
     8 1991  9891.153 10822.848           3.280395 1.3174627 .  2.515733  10998.88   11250.7   9346.98 10167.252   59704.4 10875.786 11228.647 .
     8 1992  7674.184  9767.368           3.245886 1.0525181 .  2.515308 12677.087  12854.68  7261.637  9041.968  58528.25  10094.13 13157.514 .
     8 1993  9402.027  11222.62 3.1951989999999997  .9916533 . 2.5148826  12464.84 13039.683  8878.383 10468.994   58332.2  11059.07  13027.91 .
     8 1994 11298.698  12672.19           3.146519 1.0688789 .  2.514457   12704.2  13625.38 10678.313 11897.846  58954.85  11977.29 13072.771 .
     8 1995  12203.24  13669.63           3.112936 1.0204653 .  2.514032 13499.864 14492.729 11590.783 12922.334  59727.85 13572.945 13756.825 .
     8 1996 13703.082 15067.375             3.0987  .9819661 . 2.5811894  15345.86 16637.506  13002.28  14240.41  60936.04 14808.318 15538.363 .
     8 1997 12602.615  14072.31           3.099752  .9685877 .  2.634504 14975.755 15929.514 11999.896 13343.052  61219.61 13203.415  13899.19 .
     8 1998  13972.26 15531.704 3.1106819999999997   .955942 .   2.68892  16665.65 17860.787 13326.323  14821.46  62256.12  14369.19 14836.378 .
     8 1999 15023.248 16525.398           3.122697  .9494657 .   2.74446 16551.848 18177.693 14458.356   15896.9  62443.05  16221.48  15326.21 .
     8 2000  15180.88 16633.271 3.1292429999999998  .9629675 . 2.8011475 15910.938 18276.213  14699.31 15942.625  64886.51 17348.266 15610.422 .
     8 2001 15890.313 17293.777           3.129704  .9811863 .   2.81509 16324.703 19475.023  15509.93 16646.404  67135.78 18787.008 16332.104 .
     8 2002 16402.629 17619.768           3.126187  .9891093 . 2.8291016 16887.912  20525.43 16107.815 17106.914  69969.48 19639.293   17465.9 .
     8 2003 17446.412 18275.127           3.118023 1.0022215 .  2.843183 17748.188 21963.846 17250.516  17991.37  73819.27  20725.08 19029.521 .
     8 2004 18536.969 18750.121           3.104892 1.0112946 .  2.857335 18100.652  23209.45 18389.398 18591.658  78298.45 21868.023  19747.03 .
     8 2005 19540.924 20162.416            3.08681 1.0133836 .  2.871557   18914.7 24955.135  19821.94 19931.926   83766.8 23076.555 20807.275 .
     8 2006 21242.184 21773.834           3.063021 1.0150568 .  2.878032  19736.48  26979.89  21375.19  21642.23  108180.1  24438.67  21997.06 .
     8 2007 23032.057  23260.23           3.033998 1.0144715 . 2.8845215 22026.416 29688.545 23080.734  23265.12 118847.38  25900.89 24548.234 .
     8 2008     25183  25868.79           3.002678   .966534 . 2.8910255 24299.543 32861.273 25424.363 25638.377 132814.69  27843.48  26871.64 .
     8 2009  26975.96   27709.9           2.973048  .9005824 . 2.8975446 25115.764  34214.41 27040.566  27826.95 147522.81  28777.43   27156.8 .
     8 2010 29490.846 31021.064           2.948023  .8908184 .  2.904078  27068.46 35392.934  29598.84 30864.365 163120.38  29844.18  27673.72 .
     8 2011 29684.385 31369.516           2.928592  .9031976 . 2.9106934  27902.93  36147.11 29951.076  31103.81 173394.25 30603.844  28125.42 .
     8 2012 30473.086  32366.19           2.914096   .929196 .  2.917346 28127.104  35912.91 30658.045  31867.01 163361.38  31037.57  28160.75 .
     8 2013 29908.676  30914.69            2.90379  .8825573 .  2.924037  28225.36 35634.645  29918.08  30496.79 170890.86 31348.564 28714.305 .
     8 2014  31027.82 32090.506           2.896305  .8857065 .  2.930766 29004.645 36610.047  31048.11 31698.854  211204.4  31904.84  29646.37 .
     8 2015 32037.936  33659.42           2.890513  .9263953 . 2.9375334 30027.896 37551.594  31924.98 33465.535  209133.1  32612.73 29912.727 .
     8 2016 32285.193 33697.977           2.886438  .9888083 .  2.944339 30144.943 37711.984  32107.82 33650.617 219219.45  33693.84 30641.385 .
     8 2017 33842.156 34974.945           2.884169 1.0351139 .  2.951184 31416.525   39310.7 33842.156 34974.945 217175.75 34974.945 31416.523 .
     8 2018 35248.367  35363.47            2.88274 1.0710635 . 2.9580684 32310.873  40233.17 35204.863  35406.61    224225 36398.883   32358.1 .
     8 2019  35890.02 36103.043 2.8809169999999997 1.0758977 .  2.964992 33399.168  40868.32 35808.344  36288.33 229818.33 37204.773  33426.44 .
    12 1963  57471.05  69827.02   11.7042645073607 1.9237834 . 1.1473833 37572.066  59970.55  54245.13  62272.43  450132.5  56797.29 38944.098 .
    12 1964  61155.43  73397.07 12.057254881562566  1.947606 . 1.1507708  41891.56  59693.28  57766.52  65276.29  450439.9  62737.21  45271.52 .
    12 1965  66451.12  79833.45 12.420890564991895 1.9711154 . 1.1541682  45953.12  64442.84  62904.46  69740.81  450845.2  68657.39  50439.31 .
    12 1966  58835.35  71289.06 12.811330129063712   1.99674 . 1.1575758  40796.64   54815.8  55905.03  63045.02  447855.5  64260.29  42566.89 .
    12 1967  67930.98  80227.48 13.248813622696126 2.0273483 . 1.1609933  42738.27  63214.66  64705.95   70165.3  450973.4 71811.195  43332.18 .
    12 1968   73181.4  89880.77 13.649344001235162 2.0499253 . 1.1644211  45419.79  70181.61  69923.53  79194.71  458265.8  79622.68  46179.56 .
    12 1969  79216.85  98351.16 14.046000837806211 2.0696597 . 1.1678588  47682.66  78510.03     75957  85981.22  470862.3  86312.58  49354.92 .
    12 1970  89436.19 112538.32 14.464984999999999 2.0903704 . 1.1713067  52013.73  91546.26  86291.13  99426.67  491989.8  94859.47  54326.64 .
    12 1971     87343  107739.1           14.87225 2.1516523 . 1.1791809  55059.83  91804.38  84672.71  96587.61  508130.6  85826.27  57461.09 .
    12 1972  99059.43 122230.92           15.28599 2.1606302 . 1.1871079  59760.54 100405.06  96268.22 109762.74  527393.3  104923.8  62045.86 .
    12 1973 107685.13 131344.86 15.709824999999999 2.1588356 .  1.195088  61129.73 109652.58 104614.17 120251.66  548999.4 109457.73  64660.36 .
    12 1974 152630.03  162655.6 16.149024999999998 2.2218482 .  1.203122  74685.23 146059.19 150862.75 154624.89 580054.25 113582.25  78453.31 .
    12 1975  146127.6 173863.64 16.607706999999998 2.3596933 .   1.21121  79038.02  160263.8 146541.52    166685  619113.1  120200.1  83115.91 .
    12 1976 158134.63  176241.2          17.085801 2.4882836 . 1.2193525  86823.06  163901.1 157276.14 168049.67  660831.3 127638.96  91245.25 .
    12 1977 173071.75 198491.95          17.582904 2.4780195 . 1.2275496  94369.78 190776.53 171347.86 185921.75  714133.9  139652.9  99134.52 .
    12 1978 188148.38  221450.3          18.102266  2.943366 . 1.2358018  99942.17 212741.73 185516.13  209207.3  776806.4 153861.25 104356.86 .
    12 1979  221281.2 235014.53 18.647814999999998  3.192337 . 1.2441095    116967 221614.95 217671.88  224949.6  830916.8  165366.7  118922.8 .
    12 1980  242874.9  235556.6 19.221664999999998  3.325097 .  1.252473 123549.34 231342.77  240642.5 228370.75  882873.6  166674.1 127440.55 .
    12 1981 261613.86  259866.9          19.824301 3.4531164 . 1.2763622 134324.98 250395.13  259710.4  251713.2  940377.6 171674.33    138088 .
    12 1982 263470.47 271293.28 20.452901999999998  3.668706 .  1.300707 139119.25  257856.7 262572.44 263496.84  998644.4  182661.5 141943.78 .
    12 1983    277817  285984.3          21.101875  3.834474 . 1.3255162  147246.3  269284.4 274889.25 276361.78 1054845.4  192525.2 150641.36 .
    12 1984 290657.44 298126.28          21.763575   3.96435 . 1.3507986  154629.4  279184.5  285433.2 285710.53 1115894.5 203306.64  158748.3 .
    12 1985    305785 310151.94          22.431502 4.0948553 . 1.3765633  161204.8 291674.13 300711.53 301859.13 1181126.6    210829  166262.5 .
    12 1986 255264.77 265040.13          23.102389   4.23326 . 1.4028193  158037.5 269128.84 250452.86  256789.5 1237837.1  211672.3 162963.45 .
    12 1987  247097.5  253657.2 23.774283999999998 4.3759556 .  1.429576 149544.63 237720.75    241952 246500.77 1276984.3  210190.6 153845.72 .
    12 1988    225805 229866.44          24.443467 4.5294533 . 1.4568433 145539.75  239796.3 220622.16 222903.34 1313681.4 208088.67 146045.42 .
    12 1989 231324.83  237204.5 25.106189999999998 4.6837797 . 1.4846306 151224.19    247779 224481.88  228089.9   1355378 217244.56 155566.55 .
    12 1990  243852.1 250425.25 25.758868999999997  4.820349 .  1.512948 148221.53  237286.4  232892.8 236369.63 1393288.4 218982.55 151744.66 .
    12 1991  251551.2  245636.3 26.400478999999997  4.979982 . 1.5515462 146180.48 227190.47 240278.56 225748.33 1411605.5 216354.75 146047.22 .
    12 1992  245558.7  244668.7          27.028326  5.088752 . 1.5911292 156211.95 230493.16 234893.64  236503.4 1437515.4 220249.13 154649.67 .
    12 1993 229896.23  234160.3 27.635514999999998  5.152008 .  1.631722 153021.56  222926.6 219449.45  221539.2 1462158.3  215623.9 151567.86 .
    12 1994 226097.47 235861.05 28.213773999999997  5.259706 . 1.6733506 155532.22  226069.8  213922.6 221377.53 1485824.5  213683.3 152390.53 .
    12 1995 234414.23  247243.2          28.757785  5.542014 .  1.714343 160359.56  229066.3 219605.75    229568 1508402.4 221803.23 156277.64 .
    12 1996 260677.67 260883.56          29.266405  5.731718 .  1.747206  159578.4  224040.6  241002.4 238994.53   1532841 230897.17 154801.02 .
    12 1997  261600.6  252715.1          29.742979  5.923101 .  1.780699 161051.38  222725.9 243581.06 232655.63 1560638.4 233437.05 152967.86 .
    12 1998  256556.2 262476.22 30.192753999999997  6.102909 .  1.814834 166005.17 240043.67 239312.33 243905.53 1595513.4 245342.33 156510.73 .
    12 1999 274971.66 272028.66          30.623406  6.186116 . 1.8496232 172222.95  244881.9  258345.7 256097.17 1627314.4  253193.3 160958.63 .
    12 2000  340480.3    301252 31.042234999999998  6.347883 . 1.8850795 175681.56  254284.3  322710.3  287646.8 1658962.8 262814.66  163903.9 .
    12 2001  327748.6 303689.44          31.451514  6.703431 . 1.9000146  184185.2 267954.94  313130.3 288548.16   1700578  270699.1  170908.3 .
    12 2002  333605.3  314770.2          31.855109  7.000722 . 1.9150683 197633.27 290006.78  321208.6 306326.97   1751035 285858.22  180322.4 .
    12 2003  366316.6  343126.7          32.264157  6.771677 .  1.930241  209071.5 304366.66  355455.9    335290 1807388.6 306440.03  187778.7 .
    12 2004  384903.7  360710.1          32.692163  7.888161 .  1.945534  219147.3  321294.9  375366.6  356246.2 1869723.8  319616.9  196761.3 .
    12 2005  445061.8    409619          33.149724    8.1337 . 1.9609482 228657.45  339122.4  441173.8  404565.3   1942416  338474.3 202287.45 .
    end

  • #2
    Using your example data, I cannot replicate your problem. This runs just fine on my setup:

    Code:
    .  * Example generated by -dataex-. To install: ssc install dataex (industry level dataset by country year)
    . clear
    
    . input float country1 int year str2 isic str3 isiccomb byte sourcecode long(Establishments Employment) double(Wages OutputINDSTAT4 ValueA
    > dded GrossFixed) long FemaleEmployees str16 value51
    
          country1      year       isic   isiccomb  source~e  Establishm~s    Employment       Wages  OutputIN~4  ValueAdded  GrossFixed  Fema
    > leEmpl~s           value51
      1. 4 1973 "16" "16"  3 .     0 . . . . . ""
      2. 4 1973 "32" "31A" 3 .     . . . . . . ""
      3. 4 1973 "35" "34A" 3 .     . . . . . . ""
      4. 4 1973 "28" "28"  3 .     0 . . . . . ""
      5. 4 1973 "26" "26"  3 .  1295 . . . . . ""
      6. 4 1973 "37" "37"  0 .     . . . . . . ""
      7. 4 1973 "36" "20C" 3 .     . . . . . . ""
      8. 4 1973 "25" "25"  3 .   360 . . . . . ""
      9. 4 1973 "24" "24"  3 .   259 . . . . . ""
     10. 4 1973 "21" "21"  3 .     0 . . . . . ""
     11. 4 1973 "20" "20C" 3 .  1941 . . . . . ""
     12. 4 1973 "17" "17"  3 . 12555 . . . . . ""
     13. 4 1973 "34" "34A" 3 .     0 . . . . . ""
     14. 4 1973 "22" "22"  3 .  1287 . . . . . ""
     15. 4 1973 "29" "29C" 3 .     0 . . . . . ""
     16. 4 1973 "15" "15"  3 .  4321 . . . . . ""
     17. 4 1973 "31" "31A" 3 .     0 . . . . . ""
     18. 4 1973 "18" "18A" 3 .   725 . . . . . ""
     19. 4 1973 "23" "23"  3 .     0 . . . . . ""
     20. 4 1973 "27" "27"  3 .     0 . . . . . ""
     21. 4 1973 "19" "18A" 3 .     . . . . . . ""
     22. 4 1973 "30" "29C" 3 .     . . . . . . ""
     23. 4 1973 "33" "33"  3 .     0 . . . . . ""
     24. 4 1974 "19" "18A" 3 .     . . . . . . ""
     25. 4 1974 "23" "23"  3 .     0 . . . . . ""
     26. 4 1974 "25" "25"  3 .   427 . . . . . ""
     27. 4 1974 "31" "31A" 3 .     0 . . . . . ""
     28. 4 1974 "34" "34A" 3 .     0 . . . . . ""
     29. 4 1974 "21" "21"  3 .     0 . . . . . ""
     30. 4 1974 "27" "27"  3 .     0 . . . . . ""
     31. 4 1974 "32" "31A" 3 .     . . . . . . ""
     32. 4 1974 "33" "33"  3 .     0 . . . . . ""
     33. 4 1974 "17" "17"  3 . 14243 . . . . . ""
     34. 4 1974 "24" "24"  3 .  3281 . . . . . ""
     35. 4 1974 "36" "20C" 3 .     . . . . . . ""
     36. 4 1974 "15" "15"  3 .  4845 . . . . . ""
     37. 4 1974 "16" "16"  3 .     0 . . . . . ""
     38. 4 1974 "29" "29C" 3 .     0 . . . . . ""
     39. 4 1974 "22" "22"  3 .  1326 . . . . . ""
     40. 4 1974 "37" "37"  0 .     . . . . . . ""
     41. 4 1974 "28" "28"  3 .     0 . . . . . ""
     42. 4 1974 "30" "29C" 3 .     . . . . . . ""
     43. 4 1974 "18" "18A" 3 .   720 . . . . . ""
     44. 4 1974 "35" "34A" 3 .     . . . . . . ""
     45. 4 1974 "26" "26"  3 .  1235 . . . . . ""
     46. 4 1974 "20" "20C" 3 .  2044 . . . . . ""
     47. 4 1975 "16" "16"  3 .     0 . . . . . ""
     48. 4 1975 "23" "23"  3 .     0 . . . . . ""
     49. 4 1975 "18" "18A" 3 .   874 . . . . . ""
     50. 4 1975 "15" "15"  3 .  5103 . . . . . ""
     51. 4 1975 "28" "28"  3 .     0 . . . . . ""
     52. 4 1975 "25" "25"  3 .   507 . . . . . ""
     53. 4 1975 "17" "17"  3 . 17202 . . . . . ""
     54. 4 1975 "31" "31A" 3 .     0 . . . . . ""
     55. 4 1975 "22" "22"  3 .  1447 . . . . . ""
     56. 4 1975 "34" "34A" 3 .     0 . . . . . ""
     57. 4 1975 "30" "29C" 3 .     . . . . . . ""
     58. 4 1975 "37" "37"  0 .     . . . . . . ""
     59. 4 1975 "32" "31A" 3 .     . . . . . . ""
     60. 4 1975 "21" "21"  3 .     0 . . . . . ""
     61. 4 1975 "36" "20C" 3 .     . . . . . . ""
     62. 4 1975 "26" "26"  3 .  1646 . . . . . ""
     63. 4 1975 "29" "29C" 3 .     0 . . . . . ""
     64. 4 1975 "19" "18A" 3 .     . . . . . . ""
     65. 4 1975 "24" "24"  3 .  4046 . . . . . ""
     66. 4 1975 "20" "20C" 3 .  2321 . . . . . ""
     67. 4 1975 "27" "27"  3 .     0 . . . . . ""
     68. 4 1975 "33" "33"  3 .     0 . . . . . ""
     69. 4 1975 "35" "34A" 3 .     . . . . . . ""
     70. 4 1976 "19" "18A" 3 .     . . . . . . ""
     71. 4 1976 "26" "26"  3 .  1335 . . . . . ""
     72. 4 1976 "35" "34A" 3 .     . . . . . . ""
     73. 4 1976 "36" "20C" 3 .     . . . . . . ""
     74. 4 1976 "25" "25"  3 .   583 . . . . . ""
     75. 4 1976 "28" "28"  3 .     0 . . . . . ""
     76. 4 1976 "33" "33"  3 .     0 . . . . . ""
     77. 4 1976 "29" "29C" 3 .     0 . . . . . ""
     78. 4 1976 "23" "23"  3 .     0 . . . . . ""
     79. 4 1976 "30" "29C" 3 .     . . . . . . ""
     80. 4 1976 "31" "31A" 3 .     0 . . . . . ""
     81. 4 1976 "34" "34A" 3 .     0 . . . . . ""
     82. 4 1976 "37" "37"  0 .     . . . . . . ""
     83. 4 1976 "18" "18A" 3 .   840 . . . . . ""
     84. 4 1976 "21" "21"  3 .     0 . . . . . ""
     85. 4 1976 "22" "22"  3 .  1465 . . . . . ""
     86. 4 1976 "15" "15"  3 .  4540 . . . . . ""
     87. 4 1976 "27" "27"  3 .     0 . . . . . ""
     88. 4 1976 "20" "20C" 3 .  2317 . . . . . ""
     89. 4 1976 "32" "31A" 3 .     . . . . . . ""
     90. 4 1976 "17" "17"  3 . 20520 . . . . . ""
     91. 4 1976 "24" "24"  3 .  4479 . . . . . ""
     92. 4 1976 "16" "16"  3 .     0 . . . . . ""
     93. 4 1977 "26" "26"  3 .  1416 . . . . . ""
     94. 4 1977 "32" "31A" 3 .     . . . . . . ""
     95. 4 1977 "30" "29C" 3 .     . . . . . . ""
     96. 4 1977 "37" "37"  0 .     . . . . . . ""
     97. 4 1977 "29" "29C" 3 .     0 . . . . . ""
     98. 4 1977 "23" "23"  3 .     0 . . . . . ""
     99. 4 1977 "25" "25"  3 .   623 . . . . . ""
    100. 4 1977 "31" "31A" 3 .     0 . . . . . ""
    101. end
    
    . tempfile industry_data
    
    . save `industry_data'
    file C:\Users\clyde\AppData\Local\Temp\ST_a5dc_000001.tmp saved as .dta format
    
    .
    .  * Example generated by -dataex-. To install: ssc install dataex (country level dataset by year)
    . clear
    
    . input float country1 int year float(rgdpe rgdpo) double pop float emp double avh float(hc ccon cda cgdpe cgdpo cn rgdpna rconna rwtfpna)
    
          country1      year      rgdpe      rgdpo         pop        emp         avh         hc       ccon        cda      cgdpe      cgdpo  
    >        cn     rgdpna     rconna    rwtfpna
      1.  8 1963         .         .                  .         . .         .         .         .         .         .         .         .    
    >     . .
      2.  8 1964         .         .                  .         . .         .         .         .         .         .         .         .    
    >     . .
      3.  8 1965         .         .                  .         . .         .         .         .         .         .         .         .    
    >     . .
      4.  8 1966         .         .                  .         . .         .         .         .         .         .         .         .    
    >     . .
      5.  8 1967         .         .                  .         . .         .         .         .         .         .         .         .    
    >     . .
      6.  8 1968         .         .                  .         . .         .         .         .         .         .         .         .    
    >     . .
      7.  8 1969         .         .                  .         . .         .         .         .         .         .         .         .    
    >     . .
      8.  8 1970  6681.829  6697.492 2.1507069999999997  .7691572 .  1.558792  5366.763  6417.883  6205.434  6225.113  24195.67  9084.574  569
    > 4.857 .
      9.  8 1971  6950.334  6958.496 2.2021889999999997  .7931207 . 1.5867927   5557.97  6663.237    6442.9  6456.324   25478.5  9448.031  592
    > 3.694 .
     10.  8 1972  7230.394  7246.038           2.254056  .8174835 . 1.6152965  5755.311   6911.02  6683.206  6704.356  26841.97  9827.267  616
    > 1.525 .
     11.  8 1973  7518.899  7536.605 2.3062899999999997  .8422419 . 1.6443123  5942.056  7154.137  6916.071  6939.365  28242.49 10222.117  640
    > 5.734 .
     12.  8 1974  7821.088  7855.124 2.3588459999999998   .867382 . 1.6738492  6187.133  7488.473  7241.639  7271.993 29784.926     10628  666
    > 6.873 .
     13.  8 1975  8136.811  8164.371 2.4117319999999998  .8929093 . 1.7039168  6405.759  7800.153  7545.456  7567.767  31313.83 11058.776  693
    > 3.853 .
     14.  8 1976  8450.694  8459.786 2.4649829999999997  .9188393 .  1.739009  6645.872  8088.441  7811.704  7818.528  32858.25 11504.435  719
    > 7.978 .
     15.  8 1977  8808.268  8818.585           2.518685  .9452071 . 1.7734824  6968.478 8421.1875  8151.575  8156.313  34542.08 11944.952   75
    > 15.88 .
     16.  8 1978  9165.298  9209.292            2.57285  .9720206 .  1.808639    7217.2  8740.171   8462.89  8501.086  36206.11 12458.786  780
    > 0.704 .
     17.  8 1979  9463.035 9454.9375 2.6275049999999998  .9992935 . 1.8444928  7447.752  9088.145  8734.917  8729.451 38115.273 12952.166  805
    > 2.092 .
     18.  8 1980  9974.774  9964.962            2.68269  1.027045 . 1.8810573  7980.792  9521.948  9280.454  9260.685  39936.04  13370.69  855
    > 4.962 .
     19.  8 1981  10320.93  10363.25 2.7370259999999997  1.063231 . 1.9506222  8146.265  9927.992  9621.704  9632.572  42014.68 14138.914  872
    > 1.659 .
     20.  8 1982 10414.697 10391.983           2.790275 1.1124681 .   2.02276    8295.9 10357.486  9739.414  9687.837  44387.79  14555.82  885
    > 5.192 .
     21.  8 1983 10800.652  10741.69           2.844871 1.1442642 . 2.0975652  8761.843 10597.802  10090.51  10018.06  46400.07 14716.654  933
    > 9.651 .
     22.  8 1984 10967.808 10857.104            2.90414 1.1691139 .  2.175137  9059.644 10643.997 10201.584  10085.03  48571.45  14532.46  967
    > 6.602 .
     23.  8 1985  11049.23  10957.04 2.9696719999999996 1.1883471 . 2.2555776  9141.163 10841.975 10303.645 10212.863  50552.81  14791.23  973
    > 0.233 .
     24.  8 1986  11681.79   11511.3           3.044212 1.2340144 .   2.30544   9586.23  11319.95  10908.19 10697.527  52593.05 15618.756 1016
    > 6.366 .
     25.  8 1987 11882.934 11730.335           3.124894  1.279103 . 2.3564048  9983.435 11502.114  11090.64 10873.812  54594.54  15495.66 1058
    > 3.836 .
     26.  8 1988  11635.43 11490.504           3.200977  1.306872 .  2.408496  9944.112 11495.508  10877.66 10672.263  56584.94 15275.526 1051
    > 9.218 .
     27.  8 1989 12516.765  12432.41 3.2579249999999997  1.329744 .  2.461739  10540.43 12339.514  11729.66 11567.515  58894.53 16778.729  110
    > 84.63 .
     28.  8 1990 12005.757  12096.72           3.286073 1.3240782 .  2.516159 11427.937 12632.153  11357.34 11354.654   61056.9 15105.708   11
    > 854.1 .
     29.  8 1991  9891.153 10822.848           3.280395 1.3174627 .  2.515733  10998.88   11250.7   9346.98 10167.252   59704.4 10875.786 1122
    > 8.647 .
     30.  8 1992  7674.184  9767.368           3.245886 1.0525181 .  2.515308 12677.087  12854.68  7261.637  9041.968  58528.25  10094.13 1315
    > 7.514 .
     31.  8 1993  9402.027  11222.62 3.1951989999999997  .9916533 . 2.5148826  12464.84 13039.683  8878.383 10468.994   58332.2  11059.07  130
    > 27.91 .
     32.  8 1994 11298.698  12672.19           3.146519 1.0688789 .  2.514457   12704.2  13625.38 10678.313 11897.846  58954.85  11977.29 1307
    > 2.771 .
     33.  8 1995  12203.24  13669.63           3.112936 1.0204653 .  2.514032 13499.864 14492.729 11590.783 12922.334  59727.85 13572.945 1375
    > 6.825 .
     34.  8 1996 13703.082 15067.375             3.0987  .9819661 . 2.5811894  15345.86 16637.506  13002.28  14240.41  60936.04 14808.318 1553
    > 8.363 .
     35.  8 1997 12602.615  14072.31           3.099752  .9685877 .  2.634504 14975.755 15929.514 11999.896 13343.052  61219.61 13203.415  138
    > 99.19 .
     36.  8 1998  13972.26 15531.704 3.1106819999999997   .955942 .   2.68892  16665.65 17860.787 13326.323  14821.46  62256.12  14369.19 1483
    > 6.378 .
     37.  8 1999 15023.248 16525.398           3.122697  .9494657 .   2.74446 16551.848 18177.693 14458.356   15896.9  62443.05  16221.48  153
    > 26.21 .
     38.  8 2000  15180.88 16633.271 3.1292429999999998  .9629675 . 2.8011475 15910.938 18276.213  14699.31 15942.625  64886.51 17348.266 1561
    > 0.422 .
     39.  8 2001 15890.313 17293.777           3.129704  .9811863 .   2.81509 16324.703 19475.023  15509.93 16646.404  67135.78 18787.008 1633
    > 2.104 .
     40.  8 2002 16402.629 17619.768           3.126187  .9891093 . 2.8291016 16887.912  20525.43 16107.815 17106.914  69969.48 19639.293   17
    > 465.9 .
     41.  8 2003 17446.412 18275.127           3.118023 1.0022215 .  2.843183 17748.188 21963.846 17250.516  17991.37  73819.27  20725.08 1902
    > 9.521 .
     42.  8 2004 18536.969 18750.121           3.104892 1.0112946 .  2.857335 18100.652  23209.45 18389.398 18591.658  78298.45 21868.023  197
    > 47.03 .
     43.  8 2005 19540.924 20162.416            3.08681 1.0133836 .  2.871557   18914.7 24955.135  19821.94 19931.926   83766.8 23076.555 2080
    > 7.275 .
     44.  8 2006 21242.184 21773.834           3.063021 1.0150568 .  2.878032  19736.48  26979.89  21375.19  21642.23  108180.1  24438.67  219
    > 97.06 .
     45.  8 2007 23032.057  23260.23           3.033998 1.0144715 . 2.8845215 22026.416 29688.545 23080.734  23265.12 118847.38  25900.89 2454
    > 8.234 .
     46.  8 2008     25183  25868.79           3.002678   .966534 . 2.8910255 24299.543 32861.273 25424.363 25638.377 132814.69  27843.48  268
    > 71.64 .
     47.  8 2009  26975.96   27709.9           2.973048  .9005824 . 2.8975446 25115.764  34214.41 27040.566  27826.95 147522.81  28777.43   27
    > 156.8 .
     48.  8 2010 29490.846 31021.064           2.948023  .8908184 .  2.904078  27068.46 35392.934  29598.84 30864.365 163120.38  29844.18  276
    > 73.72 .
     49.  8 2011 29684.385 31369.516           2.928592  .9031976 . 2.9106934  27902.93  36147.11 29951.076  31103.81 173394.25 30603.844  281
    > 25.42 .
     50.  8 2012 30473.086  32366.19           2.914096   .929196 .  2.917346 28127.104  35912.91 30658.045  31867.01 163361.38  31037.57  281
    > 60.75 .
     51.  8 2013 29908.676  30914.69            2.90379  .8825573 .  2.924037  28225.36 35634.645  29918.08  30496.79 170890.86 31348.564 2871
    > 4.305 .
     52.  8 2014  31027.82 32090.506           2.896305  .8857065 .  2.930766 29004.645 36610.047  31048.11 31698.854  211204.4  31904.84  296
    > 46.37 .
     53.  8 2015 32037.936  33659.42           2.890513  .9263953 . 2.9375334 30027.896 37551.594  31924.98 33465.535  209133.1  32612.73 2991
    > 2.727 .
     54.  8 2016 32285.193 33697.977           2.886438  .9888083 .  2.944339 30144.943 37711.984  32107.82 33650.617 219219.45  33693.84 3064
    > 1.385 .
     55.  8 2017 33842.156 34974.945           2.884169 1.0351139 .  2.951184 31416.525   39310.7 33842.156 34974.945 217175.75 34974.945 3141
    > 6.523 .
     56.  8 2018 35248.367  35363.47            2.88274 1.0710635 . 2.9580684 32310.873  40233.17 35204.863  35406.61    224225 36398.883   32
    > 358.1 .
     57.  8 2019  35890.02 36103.043 2.8809169999999997 1.0758977 .  2.964992 33399.168  40868.32 35808.344  36288.33 229818.33 37204.773  334
    > 26.44 .
     58. 12 1963  57471.05  69827.02   11.7042645073607 1.9237834 . 1.1473833 37572.066  59970.55  54245.13  62272.43  450132.5  56797.29 3894
    > 4.098 .
     59. 12 1964  61155.43  73397.07 12.057254881562566  1.947606 . 1.1507708  41891.56  59693.28  57766.52  65276.29  450439.9  62737.21  452
    > 71.52 .
     60. 12 1965  66451.12  79833.45 12.420890564991895 1.9711154 . 1.1541682  45953.12  64442.84  62904.46  69740.81  450845.2  68657.39  504
    > 39.31 .
     61. 12 1966  58835.35  71289.06 12.811330129063712   1.99674 . 1.1575758  40796.64   54815.8  55905.03  63045.02  447855.5  64260.29  425
    > 66.89 .
     62. 12 1967  67930.98  80227.48 13.248813622696126 2.0273483 . 1.1609933  42738.27  63214.66  64705.95   70165.3  450973.4 71811.195  433
    > 32.18 .
     63. 12 1968   73181.4  89880.77 13.649344001235162 2.0499253 . 1.1644211  45419.79  70181.61  69923.53  79194.71  458265.8  79622.68  461
    > 79.56 .
     64. 12 1969  79216.85  98351.16 14.046000837806211 2.0696597 . 1.1678588  47682.66  78510.03     75957  85981.22  470862.3  86312.58  493
    > 54.92 .
     65. 12 1970  89436.19 112538.32 14.464984999999999 2.0903704 . 1.1713067  52013.73  91546.26  86291.13  99426.67  491989.8  94859.47  543
    > 26.64 .
     66. 12 1971     87343  107739.1           14.87225 2.1516523 . 1.1791809  55059.83  91804.38  84672.71  96587.61  508130.6  85826.27  574
    > 61.09 .
     67. 12 1972  99059.43 122230.92           15.28599 2.1606302 . 1.1871079  59760.54 100405.06  96268.22 109762.74  527393.3  104923.8  620
    > 45.86 .
     68. 12 1973 107685.13 131344.86 15.709824999999999 2.1588356 .  1.195088  61129.73 109652.58 104614.17 120251.66  548999.4 109457.73  646
    > 60.36 .
     69. 12 1974 152630.03  162655.6 16.149024999999998 2.2218482 .  1.203122  74685.23 146059.19 150862.75 154624.89 580054.25 113582.25  784
    > 53.31 .
     70. 12 1975  146127.6 173863.64 16.607706999999998 2.3596933 .   1.21121  79038.02  160263.8 146541.52    166685  619113.1  120200.1  831
    > 15.91 .
     71. 12 1976 158134.63  176241.2          17.085801 2.4882836 . 1.2193525  86823.06  163901.1 157276.14 168049.67  660831.3 127638.96  912
    > 45.25 .
     72. 12 1977 173071.75 198491.95          17.582904 2.4780195 . 1.2275496  94369.78 190776.53 171347.86 185921.75  714133.9  139652.9  991
    > 34.52 .
     73. 12 1978 188148.38  221450.3          18.102266  2.943366 . 1.2358018  99942.17 212741.73 185516.13  209207.3  776806.4 153861.25 1043
    > 56.86 .
     74. 12 1979  221281.2 235014.53 18.647814999999998  3.192337 . 1.2441095    116967 221614.95 217671.88  224949.6  830916.8  165366.7  118
    > 922.8 .
     75. 12 1980  242874.9  235556.6 19.221664999999998  3.325097 .  1.252473 123549.34 231342.77  240642.5 228370.75  882873.6  166674.1 1274
    > 40.55 .
     76. 12 1981 261613.86  259866.9          19.824301 3.4531164 . 1.2763622 134324.98 250395.13  259710.4  251713.2  940377.6 171674.33    1
    > 38088 .
     77. 12 1982 263470.47 271293.28 20.452901999999998  3.668706 .  1.300707 139119.25  257856.7 262572.44 263496.84  998644.4  182661.5 1419
    > 43.78 .
     78. 12 1983    277817  285984.3          21.101875  3.834474 . 1.3255162  147246.3  269284.4 274889.25 276361.78 1054845.4  192525.2 1506
    > 41.36 .
     79. 12 1984 290657.44 298126.28          21.763575   3.96435 . 1.3507986  154629.4  279184.5  285433.2 285710.53 1115894.5 203306.64  158
    > 748.3 .
     80. 12 1985    305785 310151.94          22.431502 4.0948553 . 1.3765633  161204.8 291674.13 300711.53 301859.13 1181126.6    210829  166
    > 262.5 .
     81. 12 1986 255264.77 265040.13          23.102389   4.23326 . 1.4028193  158037.5 269128.84 250452.86  256789.5 1237837.1  211672.3 1629
    > 63.45 .
     82. 12 1987  247097.5  253657.2 23.774283999999998 4.3759556 .  1.429576 149544.63 237720.75    241952 246500.77 1276984.3  210190.6 1538
    > 45.72 .
     83. 12 1988    225805 229866.44          24.443467 4.5294533 . 1.4568433 145539.75  239796.3 220622.16 222903.34 1313681.4 208088.67 1460
    > 45.42 .
     84. 12 1989 231324.83  237204.5 25.106189999999998 4.6837797 . 1.4846306 151224.19    247779 224481.88  228089.9   1355378 217244.56 1555
    > 66.55 .
     85. 12 1990  243852.1 250425.25 25.758868999999997  4.820349 .  1.512948 148221.53  237286.4  232892.8 236369.63 1393288.4 218982.55 1517
    > 44.66 .
     86. 12 1991  251551.2  245636.3 26.400478999999997  4.979982 . 1.5515462 146180.48 227190.47 240278.56 225748.33 1411605.5 216354.75 1460
    > 47.22 .
     87. 12 1992  245558.7  244668.7          27.028326  5.088752 . 1.5911292 156211.95 230493.16 234893.64  236503.4 1437515.4 220249.13 1546
    > 49.67 .
     88. 12 1993 229896.23  234160.3 27.635514999999998  5.152008 .  1.631722 153021.56  222926.6 219449.45  221539.2 1462158.3  215623.9 1515
    > 67.86 .
     89. 12 1994 226097.47 235861.05 28.213773999999997  5.259706 . 1.6733506 155532.22  226069.8  213922.6 221377.53 1485824.5  213683.3 1523
    > 90.53 .
     90. 12 1995 234414.23  247243.2          28.757785  5.542014 .  1.714343 160359.56  229066.3 219605.75    229568 1508402.4 221803.23 1562
    > 77.64 .
     91. 12 1996 260677.67 260883.56          29.266405  5.731718 .  1.747206  159578.4  224040.6  241002.4 238994.53   1532841 230897.17 1548
    > 01.02 .
     92. 12 1997  261600.6  252715.1          29.742979  5.923101 .  1.780699 161051.38  222725.9 243581.06 232655.63 1560638.4 233437.05 1529
    > 67.86 .
     93. 12 1998  256556.2 262476.22 30.192753999999997  6.102909 .  1.814834 166005.17 240043.67 239312.33 243905.53 1595513.4 245342.33 1565
    > 10.73 .
     94. 12 1999 274971.66 272028.66          30.623406  6.186116 . 1.8496232 172222.95  244881.9  258345.7 256097.17 1627314.4  253193.3 1609
    > 58.63 .
     95. 12 2000  340480.3    301252 31.042234999999998  6.347883 . 1.8850795 175681.56  254284.3  322710.3  287646.8 1658962.8 262814.66  163
    > 903.9 .
     96. 12 2001  327748.6 303689.44          31.451514  6.703431 . 1.9000146  184185.2 267954.94  313130.3 288548.16   1700578  270699.1  170
    > 908.3 .
     97. 12 2002  333605.3  314770.2          31.855109  7.000722 . 1.9150683 197633.27 290006.78  321208.6 306326.97   1751035 285858.22  180
    > 322.4 .
     98. 12 2003  366316.6  343126.7          32.264157  6.771677 .  1.930241  209071.5 304366.66  355455.9    335290 1807388.6 306440.03  187
    > 778.7 .
     99. 12 2004  384903.7  360710.1          32.692163  7.888161 .  1.945534  219147.3  321294.9  375366.6  356246.2 1869723.8  319616.9  196
    > 761.3 .
    100. 12 2005  445061.8    409619          33.149724    8.1337 . 1.9609482 228657.45  339122.4  441173.8  404565.3   1942416  338474.3 2022
    > 87.45 .
    101. end
    
    . tempfile country_data
    
    . save `country_data'
    file C:\Users\clyde\AppData\Local\Temp\ST_a5dc_000002.tmp saved as .dta format
    
    .
    . use `industry_data', clear
    
    . merge m:1 country1 year using `country_data'
    
        Result                      Number of obs
        -----------------------------------------
        Not matched                           200
            from master                       100  (_merge==1)
            from using                        100  (_merge==2)
    
        Matched                                 0  (_merge==3)
        -----------------------------------------
    
    .
    .
    end of do-file
    Nevertheless, I have never known Stata to be wrong when it says that some set of variables fails to uniquely identify observations. So you have to find the offending observations and deal with them:

    Code:
    use country_data_set, clear
    duplicates tag country1 year, gen(flag)
    browse if flag
    will show them to you.

    Then you will have to figure out how to fix that data problem based on what you see there.

    If the surplus observations are exact duplicates, then -duplicates drop- will solve the immediate problem. But given that the data set shouldn't contain these duplicate observations, something must have gone wrong in the creation of the data set. And where one mistake is found, others may lurk as yet undetected. So the creation of the data set should be thoroughly reviewed to see what went wrong and fix any errors found in the process.

    If the surplus observations are not exact duplicates, then you have contradictory data for some country-year combinations. You will again need to vet the data management that created this data set to see why it ended up with an incorrect data set, but, in addition, you will have the task of figuring out which of the conflicting observations is the correct one, or figure out some way of combining the conflicting observations into a single one that gets things right.

    In the end, the problem is not with anything you have shown here. The problem is that the country data set is incorrect, and you need not only to fix the data set but to fix the process that led to it in the first place.

    Added: If the data set was not created within your "shop" but was acquired externally without any subsequent manipulation in your own organization, you should notify the supplier of the problem and request that they correct the data set for you.

    One more thing: when you run the code I have shown for finding the offending observations, you may find that the country1 and year variables (and everything else) are just missing values. If the data was originally imported from a spreadsheet, this is a common problem. I don't know how -import excel- goes about finding the boundaries of the data in a spreadsheet, but sometimes it gets it wrong and puts a few empty observations at the end of the Stata data set it creates. In that case, it is fair to just -drop if missing(country1, year)- and move on without revisiting everything done to create the data.
    Last edited by Clyde Schechter; 24 Mar 2022, 23:35.

    Comment


    • #3
      Thank you very much!

      In fact, there were repeated variables. The country level dataset has countries coded by country codes, the industry dataset has them by numbers. I coded every country in the country level dataset as to numbers (to match the industry level dataset). But obviously, I had some issues regarding some countries. For instance, "Democratic Republic of Congo" to "Congo", "South Korea" instead of "Republic of Korea" and so on.

      I checked for exact duplicates and found no exact duplicates, that's why I made the statament. Thank you so much!

      Comment

      Working...
      X