Announcement

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

  • Variables not constant within table

    Dear all,

    I am trying to reshape the following dataset below and I am encountering an error as follows:

    "variable tabledescription not constant within country year isic isiccombination sourcecode
    variable tabledefinitioncode not constant within country year isic isiccombination sourcecode
    variable v11 not constant within country year isic isiccombination sourcecode
    Your data are currently long. You are performing a reshape wide. You typed something like

    . reshape wide a b, i(country year isic isiccombination sourcecode) j(tablecode)

    There are variables other than a, b, country year isic isiccombination sourcecode, tablecode in your data. They must be constant
    within country year isic isiccombination sourcecode because that is the only way they can fit into wide data without loss of
    information.

    The variable or variables listed above are not constant within country year isic isiccombination sourcecode. Perhaps the values
    are in error. Type reshape error for a list of the problem observations"

    I did a similar analysis before (with less disaggregated data) and I've never had such error. Any recommendation?







    * Example generated by -dataex-. To install: ssc install dataex
    clear
    [/CODE]
    input byte tablecode str29 tabledescription int countrycode str32 countrydescription int year str4 isic str51 isicdescription str5 isiccombination str12 value byte tabledefinitioncode str36 v11 str1 unit byte sourcecode long(isic1 isiccomb1)
    14 "Output" 4 "Afghanistan" 2018 "1010" "Processing/preserving of meat" "1010A" "25836794" 14 "Output (valuation not defined)" "$" 1 1 2
    14 "Output" 4 "Afghanistan" 2018 "1020" "Processing/preserving of fish, etc." "1010A" "..." 14 "Output (valuation not defined)" "$" 1 2 2
    14 "Output" 4 "Afghanistan" 2018 "1030" "Processing/preserving of fruit,vegetables" "1010A" "..." 14 "Output (valuation not defined)" "$" 1 3 2
    14 "Output" 4 "Afghanistan" 2018 "1040" "Vegetable and animal oils and fats" "1010A" "..." 14 "Output (valuation not defined)" "$" 1 4 2
    14 "Output" 4 "Afghanistan" 2018 "1050" "Dairy products" "1010A" "..." 14 "Output (valuation not defined)" "$" 1 5 2
    14 "Output" 4 "Afghanistan" 2018 "106" "Grain mill products,starches and starch products" "1010A" "..." 14 "Output (valuation not defined)" "$" 1 6 2
    14 "Output" 4 "Afghanistan" 2018 "1061" "Grain mill products" "1061" "..." 14 "Output (valuation not defined)" "$" 0 7 14
    14 "Output" 4 "Afghanistan" 2018 "1062" "Starches and starch products" "1062" "..." 14 "Output (valuation not defined)" "$" 0 8 17
    14 "Output" 4 "Afghanistan" 2018 "107" "Other food products" "1010A" "..." 14 "Output (valuation not defined)" "$" 1 9 2
    14 "Output" 4 "Afghanistan" 2018 "1071" "Bakery products" "1071" "..." 14 "Output (valuation not defined)" "$" 0 10 19
    14 "Output" 4 "Afghanistan" 2018 "1072" "Sugar" "1072" "..." 14 "Output (valuation not defined)" "$" 0 11 21
    14 "Output" 4 "Afghanistan" 2018 "1073" "Cocoa, chocolate and sugar confectionery" "1073" "..." 14 "Output (valuation not defined)" "$" 0 12 24
    14 "Output" 4 "Afghanistan" 2018 "1074" "Macaroni, noodles, couscous, etc." "1074" "..." 14 "Output (valuation not defined)" "$" 0 13 25
    14 "Output" 4 "Afghanistan" 2018 "1075" "Prepared meals and dishes" "1075" "..." 14 "Output (valuation not defined)" "$" 0 14 26
    14 "Output" 4 "Afghanistan" 2018 "1079" "Other food products n.e.c." "1079" "..." 14 "Output (valuation not defined)" "$" 0 15 29
    14 "Output" 4 "Afghanistan" 2018 "1080" "Prepared animal feeds" "1010A" "..." 14 "Output (valuation not defined)" "$" 1 16 2
    14 "Output" 4 "Afghanistan" 2018 "110" "Beverages" "110" "20001874" 14 "Output (valuation not defined)" "$" 1 17 35
    14 "Output" 4 "Afghanistan" 2018 "1101" "Distilling, rectifying and blending of spirits" "1101" "..." 14 "Output (valuation not defined)" "$" 0 18 36
    14 "Output" 4 "Afghanistan" 2018 "1102" "Wines" "1102" "..." 14 "Output (valuation not defined)" "$" 0 19 43
    14 "Output" 4 "Afghanistan" 2018 "1103" "Malt liquors and malt" "1103" "..." 14 "Output (valuation not defined)" "$" 0 20 45
    14 "Output" 4 "Afghanistan" 2018 "1104" "Soft drinks,mineral waters,other bottled waters" "1104" "..." 14 "Output (valuation not defined)" "$" 0 21 47
    14 "Output" 4 "Afghanistan" 2018 "1200" "Tobacco products" "1200" "90174" 14 "Output (valuation not defined)" "$" 1 22 50
    14 "Output" 4 "Afghanistan" 2018 "131" "Spinning, weaving and finishing of textiles" "131A" "1502430" 14 "Output (valuation not defined)" "$" 1 23 59
    14 "Output" 4 "Afghanistan" 2018 "1311" "Preparation and spinning of textile fibres" "1311" "..." 14 "Output (valuation not defined)" "$" 0 24 54
    14 "Output" 4 "Afghanistan" 2018 "1312" "Weaving of textiles" "1312" "..." 14 "Output (valuation not defined)" "$" 0 25 56
    14 "Output" 4 "Afghanistan" 2018 "1313" "Finishing of textiles" "1313" "..." 14 "Output (valuation not defined)" "$" 0 26 58
    14 "Output" 4 "Afghanistan" 2018 "139" "Other textiles" "131A" "..." 14 "Output (valuation not defined)" "$" 1 27 59
    14 "Output" 4 "Afghanistan" 2018 "1391" "Knitted and crocheted fabrics" "1391" "..." 14 "Output (valuation not defined)" "$" 0 28 64
    14 "Output" 4 "Afghanistan" 2018 "1392" "Made-up textile articles, except apparel" "1392" "..." 14 "Output (valuation not defined)" "$" 0 29 68
    14 "Output" 4 "Afghanistan" 2018 "1393" "Carpets and rugs" "1393" "..." 14 "Output (valuation not defined)" "$" 0 30 71
    14 "Output" 4 "Afghanistan" 2018 "1394" "Cordage, rope, twine and netting" "1394" "..." 14 "Output (valuation not defined)" "$" 0 31 72
    14 "Output" 4 "Afghanistan" 2018 "1399" "Other textiles n.e.c." "1399" "..." 14 "Output (valuation not defined)" "$" 0 32 74
    14 "Output" 4 "Afghanistan" 2018 "1410" "Wearing apparel, except fur apparel" "1410A" "4162" 14 "Output (valuation not defined)" "$" 1 33 77
    14 "Output" 4 "Afghanistan" 2018 "1420" "Articles of fur" "1410A" "..." 14 "Output (valuation not defined)" "$" 1 34 77
    14 "Output" 4 "Afghanistan" 2018 "1430" "Knitted and crocheted apparel" "1410A" "..." 14 "Output (valuation not defined)" "$" 1 35 77
    14 "Output" 4 "Afghanistan" 2018 "151" "Leather;luggage,handbags,saddlery,harness;fur " "151A" "516070" 14 "Output (valuation not defined)" "$" 1 36 86
    14 "Output" 4 "Afghanistan" 2018 "1511" "Tanning/dressing of leather; dressing of fur" "1511" "..." 14 "Output (valuation not defined)" "$" 0 37 83
    14 "Output" 4 "Afghanistan" 2018 "1512" "Luggage,handbags,etc.;saddlery/harness" "1512" "..." 14 "Output (valuation not defined)" "$" 0 38 85
    14 "Output" 4 "Afghanistan" 2018 "1520" "Footwear" "151A" "..." 14 "Output (valuation not defined)" "$" 1 39 86
    14 "Output" 4 "Afghanistan" 2018 "1610" "Sawmilling and planing of wood" "1610A" "45780" 14 "Output (valuation not defined)" "$" 1 40 91
    14 "Output" 4 "Afghanistan" 2018 "162" "Wood products, cork, straw, plaiting materials" "1610A" "..." 14 "Output (valuation not defined)" "$" 1 41 91
    14 "Output" 4 "Afghanistan" 2018 "1621" "Veneer sheets and wood-based panels" "1621" "..." 14 "Output (valuation not defined)" "$" 0 42 95
    14 "Output" 4 "Afghanistan" 2018 "1622" "Builders' carpentry and joinery" "1622" "..." 14 "Output (valuation not defined)" "$" 0 43 99
    14 "Output" 4 "Afghanistan" 2018 "1623" "Wooden containers" "1623" "..." 14 "Output (valuation not defined)" "$" 0 44 100
    14 "Output" 4 "Afghanistan" 2018 "1629" "Other wood products;articles of cork,straw" "1629" "..." 14 "Output (valuation not defined)" "$" 0 45 102
    14 "Output" 4 "Afghanistan" 2018 "170" "Paper and paper products" "170" "15260" 14 "Output (valuation not defined)" "$" 1 46 105
    14 "Output" 4 "Afghanistan" 2018 "1701" "Pulp, paper and paperboard" "1701" "..." 14 "Output (valuation not defined)" "$" 0 47 106
    14 "Output" 4 "Afghanistan" 2018 "1702" "Corrugated paper and paperboard" "1702" "..." 14 "Output (valuation not defined)" "$" 0 48 110
    14 "Output" 4 "Afghanistan" 2018 "1709" "Other articles of paper and paperboard" "1709" "..." 14 "Output (valuation not defined)" "$" 0 49 111
    14 "Output" 4 "Afghanistan" 2018 "181" "Printing and service activities related to printing" "181A" "3601874" 14 "Output (valuation not defined)" "$" 1 50 119
    14 "Output" 4 "Afghanistan" 2018 "1811" "Printing" "1811" "..." 14 "Output (valuation not defined)" "$" 0 51 115
    14 "Output" 4 "Afghanistan" 2018 "1812" "Service activities related to printing" "1812" "..." 14 "Output (valuation not defined)" "$" 0 52 117
    14 "Output" 4 "Afghanistan" 2018 "1820" "Reproduction of recorded media" "181A" "..." 14 "Output (valuation not defined)" "$" 1 53 119
    14 "Output" 4 "Afghanistan" 2018 "1910" "Coke oven products" "1910A" "3021507" 14 "Output (valuation not defined)" "$" 1 54 123
    14 "Output" 4 "Afghanistan" 2018 "1920" "Refined petroleum products" "1910A" "..." 14 "Output (valuation not defined)" "$" 1 55 123
    14 "Output" 4 "Afghanistan" 2018 "201" "Basic chemicals,fertilizers, etc." "201A" "5188446" 14 "Output (valuation not defined)" "$" 1 56 137
    14 "Output" 4 "Afghanistan" 2018 "2011" "Basic chemicals" "2011" "..." 14 "Output (valuation not defined)" "$" 0 57 129
    14 "Output" 4 "Afghanistan" 2018 "2012" "Fertilizers and nitrogen compounds" "2012" "..." 14 "Output (valuation not defined)" "$" 0 58 133
    14 "Output" 4 "Afghanistan" 2018 "2013" "Plastics and synthetic rubber in primary forms" "2013" "..." 14 "Output (valuation not defined)" "$" 0 59 135
    14 "Output" 4 "Afghanistan" 2018 "202" "Other chemical products" "201A" "..." 14 "Output (valuation not defined)" "$" 1 60 137
    14 "Output" 4 "Afghanistan" 2018 "2021" "Pesticides and other agrochemical products" "2021" "..." 14 "Output (valuation not defined)" "$" 0 61 142
    14 "Output" 4 "Afghanistan" 2018 "2022" "Paints,varnishes;printing ink and mastics" "2022" "..." 14 "Output (valuation not defined)" "$" 0 62 144
    14 "Output" 4 "Afghanistan" 2018 "2023" "Soap,cleaning and cosmetic preparations" "2023" "..." 14 "Output (valuation not defined)" "$" 0 63 145
    14 "Output" 4 "Afghanistan" 2018 "2029" "Other chemical products n.e.c." "2029" "..." 14 "Output (valuation not defined)" "$" 0 64 146
    14 "Output" 4 "Afghanistan" 2018 "2030" "Man-made fibres" "201A" "..." 14 "Output (valuation not defined)" "$" 1 65 137
    14 "Output" 4 "Afghanistan" 2018 "2100" "Pharmaceuticals,medicinal chemicals, etc." "2100" "1596765" 14 "Output (valuation not defined)" "$" 1 66 150
    14 "Output" 4 "Afghanistan" 2018 "221" "Rubber products" "221A" "1921390" 14 "Output (valuation not defined)" "$" 1 67 156
    14 "Output" 4 "Afghanistan" 2018 "2211" "Rubber tyres and tubes" "2211" "..." 14 "Output (valuation not defined)" "$" 0 68 153
    14 "Output" 4 "Afghanistan" 2018 "2219" "Other rubber products" "2219" "..." 14 "Output (valuation not defined)" "$" 0 69 155
    14 "Output" 4 "Afghanistan" 2018 "2220" "Plastics products" "221A" "..." 14 "Output (valuation not defined)" "$" 1 70 156
    14 "Output" 4 "Afghanistan" 2018 "2310" "Glass and glass products" "2310A" "26558182" 14 "Output (valuation not defined)" "$" 1 71 160
    14 "Output" 4 "Afghanistan" 2018 "239" "Non-metallic mineral products n.e.c." "2310A" "..." 14 "Output (valuation not defined)" "$" 1 72 160
    14 "Output" 4 "Afghanistan" 2018 "2391" "Refractory products" "2391" "..." 14 "Output (valuation not defined)" "$" 0 73 163
    14 "Output" 4 "Afghanistan" 2018 "2392" "Clay building materials" "2392" "..." 14 "Output (valuation not defined)" "$" 0 74 168
    14 "Output" 4 "Afghanistan" 2018 "2393" "Other porcelain and ceramic products" "2393" "..." 14 "Output (valuation not defined)" "$" 0 75 170
    14 "Output" 4 "Afghanistan" 2018 "2394" "Cement, lime and plaster" "2394" "..." 14 "Output (valuation not defined)" "$" 0 76 172
    14 "Output" 4 "Afghanistan" 2018 "2395" "Articles of concrete, cement and plaster" "2395" "..." 14 "Output (valuation not defined)" "$" 0 77 174
    14 "Output" 4 "Afghanistan" 2018 "2396" "Cutting, shaping and finishing of stone" "2396" "..." 14 "Output (valuation not defined)" "$" 0 78 176
    14 "Output" 4 "Afghanistan" 2018 "2399" "Other non-metallic mineral products n.e.c." "2399" "..." 14 "Output (valuation not defined)" "$" 0 79 178
    14 "Output" 4 "Afghanistan" 2018 "2410" "Basic iron and steel" "2410A" "29227318" 14 "Output (valuation not defined)" "$" 1 80 181
    14 "Output" 4 "Afghanistan" 2018 "2420" "Basic precious and other non-ferrous metals" "2410A" "..." 14 "Output (valuation not defined)" "$" 1 81 181
    14 "Output" 4 "Afghanistan" 2018 "243" "Casting of metals" "2410A" "..." 14 "Output (valuation not defined)" "$" 1 82 181
    14 "Output" 4 "Afghanistan" 2018 "2431" "Casting of iron and steel" "2431" "..." 14 "Output (valuation not defined)" "$" 0 83 186
    14 "Output" 4 "Afghanistan" 2018 "2432" "Casting of non-ferrous metals" "2432" "..." 14 "Output (valuation not defined)" "$" 0 84 188
    14 "Output" 4 "Afghanistan" 2018 "251" "Struct.metal products, tanks, reservoirs" "251A" "1363701" 14 "Output (valuation not defined)" "$" 1 85 197
    14 "Output" 4 "Afghanistan" 2018 "2511" "Structural metal products" "2511" "..." 14 "Output (valuation not defined)" "$" 0 86 190
    14 "Output" 4 "Afghanistan" 2018 "2512" "Tanks, reservoirs and containers of metal" "2512" "..." 14 "Output (valuation not defined)" "$" 0 87 192
    14 "Output" 4 "Afghanistan" 2018 "2513" "Steam generators, excl. hot water boilers" "2513" "..." 14 "Output (valuation not defined)" "$" 0 88 195
    14 "Output" 4 "Afghanistan" 2018 "2520" "Weapons and ammunition" "251A" "..." 14 "Output (valuation not defined)" "$" 1 89 197
    14 "Output" 4 "Afghanistan" 2018 "259" "Other metal products;metal working services" "251A" "..." 14 "Output (valuation not defined)" "$" 1 90 197
    14 "Output" 4 "Afghanistan" 2018 "2591" "Forging,pressing,stamping,roll-forming of metal" "2591" "..." 14 "Output (valuation not defined)" "$" 0 91 206
    14 "Output" 4 "Afghanistan" 2018 "2592" "Treatment and coating of metals; machining" "2592" "..." 14 "Output (valuation not defined)" "$" 0 92 209
    14 "Output" 4 "Afghanistan" 2018 "2593" "Cutlery, hand tools and general hardware" "2593" "..." 14 "Output (valuation not defined)" "$" 0 93 210
    14 "Output" 4 "Afghanistan" 2018 "2599" "Other fabricated metal products n.e.c." "2599" "..." 14 "Output (valuation not defined)" "$" 0 94 211
    14 "Output" 4 "Afghanistan" 2018 "2610" "Electronic components and boards" "2610" "..." 14 "Output (valuation not defined)" "$" 0 95 213
    14 "Output" 4 "Afghanistan" 2018 "2620" "Computers and peripheral equipment" "2620" "..." 14 "Output (valuation not defined)" "$" 0 96 222
    14 "Output" 4 "Afghanistan" 2018 "2630" "Communication equipment" "2630" "..." 14 "Output (valuation not defined)" "$" 0 97 224
    14 "Output" 4 "Afghanistan" 2018 "2640" "Consumer electronics" "2640" "..." 14 "Output (valuation not defined)" "$" 0 98 228
    14 "Output" 4 "Afghanistan" 2018 "265" "Measuring,testing equipment; watches, etc." "265" "..." 14 "Output (valuation not defined)" "$" 0 99 230
    14 "Output" 4 "Afghanistan" 2018 "2651" "Measuring/testing/navigating equipment,etc." "2651" "..." 14 "Output (valuation not defined)" "$" 0 100 231
    end
    label values isic1 isic1
    label def isic1 1 "1010", modify
    label def isic1 2 "1020", modify
    label def isic1 3 "1030", modify
    label def isic1 4 "1040", modify
    label def isic1 5 "1050", modify
    label def isic1 6 "106", modify
    label def isic1 7 "1061", modify
    label def isic1 8 "1062", modify
    label def isic1 9 "107", modify
    label def isic1 10 "1071", modify
    label def isic1 11 "1072", modify
    label def isic1 12 "1073", modify
    label def isic1 13 "1074", modify
    label def isic1 14 "1075", modify
    label def isic1 15 "1079", modify
    label def isic1 16 "1080", modify
    label def isic1 17 "110", modify
    label def isic1 18 "1101", modify
    label def isic1 19 "1102", modify
    label def isic1 20 "1103", modify
    label def isic1 21 "1104", modify
    label def isic1 22 "1200", modify
    label def isic1 23 "131", modify
    label def isic1 24 "1311", modify
    label def isic1 25 "1312", modify
    label def isic1 26 "1313", modify
    label def isic1 27 "139", modify
    label def isic1 28 "1391", modify
    label def isic1 29 "1392", modify
    label def isic1 30 "1393", modify
    label def isic1 31 "1394", modify
    label def isic1 32 "1399", modify
    label def isic1 33 "1410", modify
    label def isic1 34 "1420", modify
    label def isic1 35 "1430", modify
    label def isic1 36 "151", modify
    label def isic1 37 "1511", modify
    label def isic1 38 "1512", modify
    label def isic1 39 "1520", modify
    label def isic1 40 "1610", modify
    label def isic1 41 "162", modify
    label def isic1 42 "1621", modify
    label def isic1 43 "1622", modify
    label def isic1 44 "1623", modify
    label def isic1 45 "1629", modify
    label def isic1 46 "170", modify
    label def isic1 47 "1701", modify
    label def isic1 48 "1702", modify
    label def isic1 49 "1709", modify
    label def isic1 50 "181", modify
    label def isic1 51 "1811", modify
    label def isic1 52 "1812", modify
    label def isic1 53 "1820", modify
    label def isic1 54 "1910", modify
    label def isic1 55 "1920", modify
    label def isic1 56 "201", modify
    label def isic1 57 "2011", modify
    label def isic1 58 "2012", modify
    label def isic1 59 "2013", modify
    label def isic1 60 "202", modify
    label def isic1 61 "2021", modify
    label def isic1 62 "2022", modify
    label def isic1 63 "2023", modify
    label def isic1 64 "2029", modify
    label def isic1 65 "2030", modify
    label def isic1 66 "2100", modify
    label def isic1 67 "221", modify
    label def isic1 68 "2211", modify
    label def isic1 69 "2219", modify
    label def isic1 70 "2220", modify
    label def isic1 71 "2310", modify
    label def isic1 72 "239", modify
    label def isic1 73 "2391", modify
    label def isic1 74 "2392", modify
    label def isic1 75 "2393", modify
    label def isic1 76 "2394", modify
    label def isic1 77 "2395", modify
    label def isic1 78 "2396", modify
    label def isic1 79 "2399", modify
    label def isic1 80 "2410", modify
    label def isic1 81 "2420", modify
    label def isic1 82 "243", modify
    label def isic1 83 "2431", modify
    label def isic1 84 "2432", modify
    label def isic1 85 "251", modify
    label def isic1 86 "2511", modify
    label def isic1 87 "2512", modify
    label def isic1 88 "2513", modify
    label def isic1 89 "2520", modify
    label def isic1 90 "259", modify
    label def isic1 91 "2591", modify
    label def isic1 92 "2592", modify
    label def isic1 93 "2593", modify
    label def isic1 94 "2599", modify
    label def isic1 95 "2610", modify
    label def isic1 96 "2620", modify
    label def isic1 97 "2630", modify
    label def isic1 98 "2640", modify
    label def isic1 99 "265", modify
    label def isic1 100 "2651", modify
    label values isiccomb1 isiccomb1
    label def isiccomb1 2 "1010A", modify
    label def isiccomb1 14 "1061", modify
    label def isiccomb1 17 "1062", modify
    label def isiccomb1 19 "1071", modify
    label def isiccomb1 21 "1072", modify
    label def isiccomb1 24 "1073", modify
    label def isiccomb1 25 "1074", modify
    label def isiccomb1 26 "1075", modify
    label def isiccomb1 29 "1079", modify
    label def isiccomb1 35 "110", modify
    label def isiccomb1 36 "1101", modify
    label def isiccomb1 43 "1102", modify
    label def isiccomb1 45 "1103", modify
    label def isiccomb1 47 "1104", modify
    label def isiccomb1 50 "1200", modify
    label def isiccomb1 54 "1311", modify
    label def isiccomb1 56 "1312", modify
    label def isiccomb1 58 "1313", modify
    label def isiccomb1 59 "131A", modify
    label def isiccomb1 64 "1391", modify
    label def isiccomb1 68 "1392", modify
    label def isiccomb1 71 "1393", modify
    label def isiccomb1 72 "1394", modify
    label def isiccomb1 74 "1399", modify
    label def isiccomb1 77 "1410A", modify
    label def isiccomb1 83 "1511", modify
    label def isiccomb1 85 "1512", modify
    label def isiccomb1 86 "151A", modify
    label def isiccomb1 91 "1610A", modify
    label def isiccomb1 95 "1621", modify
    label def isiccomb1 99 "1622", modify
    label def isiccomb1 100 "1623", modify
    label def isiccomb1 102 "1629", modify
    label def isiccomb1 105 "170", modify
    label def isiccomb1 106 "1701", modify
    label def isiccomb1 110 "1702", modify
    label def isiccomb1 111 "1709", modify
    label def isiccomb1 115 "1811", modify
    label def isiccomb1 117 "1812", modify
    label def isiccomb1 119 "181A", modify
    label def isiccomb1 123 "1910A", modify
    label def isiccomb1 129 "2011", modify
    label def isiccomb1 133 "2012", modify
    label def isiccomb1 135 "2013", modify
    label def isiccomb1 137 "201A", modify
    label def isiccomb1 142 "2021", modify
    label def isiccomb1 144 "2022", modify
    label def isiccomb1 145 "2023", modify
    label def isiccomb1 146 "2029", modify
    label def isiccomb1 150 "2100", modify
    label def isiccomb1 153 "2211", modify
    label def isiccomb1 155 "2219", modify
    label def isiccomb1 156 "221A", modify
    label def isiccomb1 160 "2310A", modify
    label def isiccomb1 163 "2391", modify
    label def isiccomb1 168 "2392", modify
    label def isiccomb1 170 "2393", modify
    label def isiccomb1 172 "2394", modify
    label def isiccomb1 174 "2395", modify
    label def isiccomb1 176 "2396", modify
    label def isiccomb1 178 "2399", modify
    label def isiccomb1 181 "2410A", modify
    label def isiccomb1 186 "2431", modify
    label def isiccomb1 188 "2432", modify
    label def isiccomb1 190 "2511", modify
    label def isiccomb1 192 "2512", modify
    label def isiccomb1 195 "2513", modify
    label def isiccomb1 197 "251A", modify
    label def isiccomb1 206 "2591", modify
    label def isiccomb1 209 "2592", modify
    label def isiccomb1 210 "2593", modify
    label def isiccomb1 211 "2599", modify
    label def isiccomb1 213 "2610", modify
    label def isiccomb1 222 "2620", modify
    label def isiccomb1 224 "2630", modify
    label def isiccomb1 228 "2640", modify
    label def isiccomb1 230 "265", modify
    label def isiccomb1 231 "2651", modify
    [/CODE]
    ------------------ copy up to and including the previous line ------------------

    Listed 100 out of 954504 observations
    Use the count() option to list more

  • #2
    Well, if you want help that gets it right the first time, you have to give a data example that exhibits the problem you are facing. In your example, the -reshape- command breaks because country is ambiguous as between countrycode and countrydescription. When that error is fixed, it breaks again because there are no a or b variable in the data set to -reshape-. Moreover, within the example data provided the variables tabledescription,l tabledefinitioncode and v11 are, in fact, constant within countrycode (which is what I assume you meant by country) year isic isiccombination sourcecodeSo it is impossible to advise you what to do.

    You can fix the country ambiguity by specifying either countrycode or countrydescription: at least in your example data they are in exact 1:1 correspondence.

    Evidently your a and b are referring to some other variables in the dataset which you haven't shown. Since your actual Stata run didn't complain about that, I'm guessing they are not a problem in the full data.

    So let's pretend we don't have those problems in the real data. Then the message you are getting has to be taken at face value. So there are three possibilities:

    Case 1. The variables tabledescription, tabledefinitioncode, and v11 should be constant within countrycode year isic isiccombination sourcecode. But they aren't, which means your data are wrong. You need to identify the offending observations and fix the error that led to this situation. You can find them as follows:

    Code:
    gen byte problem = 0
    foreach v of varlist tabledescription tabledefinitioncode v11 {
        by countrycode year isic isiccombination sourcecode (`v'), sort: replace problem = 1 if `v'[1] != `v'[_N]
    }
    browse if problem
    Case 2a. Those variables are not expected to be constant within countrycode year isic isiccombination sourcecode, and you do need these variables. In this case you have to add tabledescription, tabledefinitioncode, and v11 to the list of variables to be reshaped wide, alongside a and b.

    Case 2b. Those variables are not expected to be constant within countrycode year isic isiccombination sourcecode, but you no longer need them. Then just -drop- those variables and try again.

    If this advice does not help you resolve the problem, then post back with a data example that actually produces the same error message you are encountering when you use the same -reshape- command you are showing.

    Comment


    • #3
      Thank you very much, Professor Schechter! Problem fixed!

      Comment

      Working...
      X