Announcement

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

  • Histogram xlabels: Removing scientific notation, selecting values

    I have data, attached, on sales of several hundred firms. Stata is giving me a histogram with evenly spaced horizontal categories that use scientific notation.
    I would like to use non-scientific notation, with commas, and call out the two largest values as missing value codes. Below I illustrate what Stata gives me and what I want. I got what I want by editing the image in paint.net -- is there a way to get what I want directly from Stata?

    Code:
    histogram O9, freq
    What Stata gives me:


    What I want:
    Last edited by paulvonhippel; 05 May 2024, 07:36.

  • #2
    Sorry, I had a little trouble uploading the images. Let me try again.
    What Stata gives me:
    Click image for larger version

Name:	Sales.png
Views:	1
Size:	45.7 KB
ID:	1752332

    What I want:
    Click image for larger version

Name:	Sales, with missing value codes.png
Views:	1
Size:	62.5 KB
ID:	1752333

    Comment


    • #3
      There is no display format that places intermediate commas, so you will need to use value labels, e.g.,

      Code:
      xlab(0 "0" 2e+10 "20,000,000,000" ...)
      Otherwise, without commas

      Code:
      xlab(, format(%13.0g))

      Comment


      • #4
        Perhaps the point of this is pedagogic, to show the (bad) effects of taking codes for missing literally, here meaning numerically.

        Otherwise, I would use billions, or logarithms, or quite possibly both.

        Comment


        • #5
          It's pedagogic, yes.

          Comment

          Working...
          X