Announcement

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

  • Estpost labels: Text instead of numbers

    I am creating a summary table by category. However, the output is labelled in an uninformative manner. When I run:
    Code:
    estpost tabstat at, by(ffind) c(stat) stat(mean median n)
    The output displays numbers for the variable "ffind" when I would like text. For example, I would like it to display "Food Products" rather than "1". I don't have this problem when do the same procedure with the sample auto.dta dataset. So I'm thinking the issue is in how the variable "ffind" is labelled.

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input long gvkey double at float ffind
     6571 119.61437276308874 14
     1350  161.3900337262666 23
     4579 136.91349346940206  1
    10974  598.9223037213313  3
     1904 34.326980408162484 23
     5181 267.36510992975826 13
     6386 472.62904514562547 13
     5685 103.35924035503743 27
    21686 54.217010276033314 26
    10456  54.16129179944068  6
    10482  55343.11001348446 19
     3520 286.40763244314115  8
     2542   541.293269891849 26
    10884  1484.098280937324  1
     3627  3713.783092469093 24
     5272  63.04545626456632 11
     9526 239.95308572188173 21
    10426 1999.5924298910834 24
    10484  1941.881284622412 25
     7022 179.13490224532103  4
     7602  73.22140962122121 13
     9293 424.15397051003316 10
     3031 45.363637600603596 23
    10407 160.31232108690907  8
    11645 288.23461196509965 23
     6460   83.9193571270071 22
     3502  410.3475185206582 15
     6815 179.19501954901307 22
     1255   54.0469222948558 19
     5855  45.63489860506774 22
    10565  920.3138080861481 25
     6938 113.36950455761422 19
     8853  840.3152721804228 19
     3124 310.92669469530006 28
     5142 322.78739883103225 13
    11445 29.994135715235217 15
    10609  81.21994356366393  1
     2156 53.526394421424605  6
     1875  89.57478250115955 23
    10610  84.69061814510515 27
     2132  77.49413701045641 27
     4467 143.24780449256474 23
     2710  88.85190858115509  2
     7718 133.55865466824554 22
     3615  74.88709881620103 27
     4977 194.01613432265393 13
    10636  96.04692344010402 19
    10639 1610.7962316061767 27
     7420 358.11877809356196  8
     3851  4792.992799316137 25
     5122 389.23608099484875 23
     9595 155.28299543657388 22
     2352 103.98240752745505 30
    10665  4221.240584312214 25
    10684 146.89149960658312 23
    10686   32.0058659753693 26
     6989  50.92082250286902 13
    10706 231.84018227485416 28
     3863  642.8592550660235  5
     6266  6658.901941104492  8
     2490 16750.883154707182 25
    11694  32.47360792360747 23
    10726 2547.1276354370075 21
    10301 5103.5397286051875 15
    10859  192.1539641839001 22
    10608 105.71847795602557  4
     3650 2207.5396496375956 13
     5087 2109.1364211479035 13
     4806 181.28006359413746 22
     5211 1118.5542826999438  4
    10759 123.97800924571193 26
     5109  483.0513328198477 27
     2874  99.26833115257819 26
    10095 1367.3284830318594 27
     4471 238.84311501712847  8
    10379 51.890030740440906 23
     4936   54.8797668923457 22
     4312  448.9310972853579 28
     6534 137.92962252936775 23
     2751 116.15836093864559 26
    10375 50.608505778810304 26
     1632  434.1451731285124 23
     5185 169.11437411284558  2
     9530   376.244878294566 19
    10795  7564.573520052375 25
    10799  185.8269845392364 11
     1772  80.80938636771819 14
     6020 53.259532244059876 23
     6523   118.674490039513 28
    10822  50.14516265767155 23
     6910  50.66275797970313  4
    10840 100.75806726358127  7
     5549  37.17448781718608  6
     8003  460.9384289910708 12
    10857 15422.287810561402  9
    10970 27843.109263619554 19
     2169  556.1451764551858 26
     7620   3937.05142700288 19
    10915  631.4677591542293  6
    10914 37.409091929155075  4
    end
    label values ffind ffind
    label def ffind 1 "Food Products", modify
    label def ffind 2 "Beer & Liquor", modify
    label def ffind 3 "Tobacco Products", modify
    label def ffind 4 "Recreation", modify
    label def ffind 5 "Printing and Publishing", modify
    label def ffind 6 "Consumer Goods", modify
    label def ffind 7 "Apparel", modify
    label def ffind 8 "Healthcare, Medical Equipment, Pharmaceutical Products", modify
    label def ffind 9 "Chemicals", modify
    label def ffind 10 "Textiles", modify
    label def ffind 11 "Construction and Construction Materials", modify
    label def ffind 12 "Steel Works Etc", modify
    label def ffind 13 "Fabricated Products and Machinery", modify
    label def ffind 14 "Electrical Equipment", modify
    label def ffind 15 "Automobiles and Trucks", modify
    label def ffind 19 "Petroleum and Natural Gas", modify
    label def ffind 21 "Communication", modify
    label def ffind 22 "Personal and Business Services", modify
    label def ffind 23 "Business Equipment", modify
    label def ffind 24 "Business Supplies and Shipping Containers", modify
    label def ffind 25 "Transportation", modify
    label def ffind 26 "Wholesale", modify
    label def ffind 27 "Retail", modify
    label def ffind 28 "Restaurants, Hotels, Motels", modify
    label def ffind 30 "Everything Else", modify

  • #2
    Run it through esttab to see the labels. estpost and esttab are part of the estout package from SSC (FAQ Advice #12).

    Comment

    Working...
    X