Announcement

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

  • How to turn off scientific notation?

    Dear Stata users,

    Stata use scientific notation as default to display number values which greater than 100 million (?). I see 1.50e+07, 3.60e+07, and so on. This holds true in -summarize-, -tabstat- and many other commands where the format option may not be suit to. I can't find any solution in -set- command to change this default setting. I want Stata to display numbers as it is. Would anyone have a solution? Thank you.

  • #2
    There is no such setting so far as I know. Stata tends to use scientific notation when there isn't enough space to show very large or very small numbers. The main solution remains what it was long before software, to change units of measurement or numbering -- to work in millions or billions, say -- and as a valued side-effect or even goal to see only defensible numbers of significant figures (mathematical or scientific sense).

    A number "as it is" for Stata would be in binary. Naturally you don't mean that....

    Comment


    • #3
      Thank you very much, Nick. It seems that I have to adapt to the scientific notation.

      Comment


      • #4
        Not what I am saying at all....

        Comment


        • #5
          Chen Samulsion there seems to be some miscommunication here.

          I think Nick's point is that it is very rare for us to have an analytical problem that really requires us to think of so many "significant digits". We usually care about much fewer than that. You might want to think whether seeing that many numbers is actually needed for your work. If not, it might be better to scale the variable: e.g. instead of having a number like 1,234,567,890, you might want to divide it by say 10^6 and think of it as say 1,234.6 millions, or divide it by 10^9 and think of it as 1.235 billions. A variable scaled this way will not (by default) be shown in scientific notation in Stata.

          One application where you might care for all the digits is when the number is an ID, or a phone number, or similar. For those cases, you might be better off storing the number as a string instead. But perhaps that is not your application, since you were talking about doing summarize and tabstat on the numbers...

          Comment


          • #6
            #7 Hemanshu Kumar is right. (Preparing the conjugal dinner was taking most of my attention at the time I last posted.)

            In economics, the first digit is often correct. The second digit is usually in doubt. I see extraordinary data listings here (e.g.) for GDP when many countries are torn by wars or other disasters, and data collection is thus at a minimum very difficult; and even in those countries that aren't it is moot whether GDP correctly takes account of the many unorthodox sectors of the economy (e.g. crime, corruption, etc.). Beats me how the number of digits reported is defensible.

            I don't single out economics for any reason except fun. Measurement is very difficult in my own fields too. You can't measure the depth of a small stream without error. I can count the number of laptops on my desk confidently, but not much else.

            Comment


            • #7
              Thank you Hemanshu Kumar Nick Cox. When I replied in #3 what I mean is if I take no operation to the numbers, i.e. "to change units of measurement or numbering", I "have to" adapt to scientific notation. Your follow-up posts make me more clear about what Nick said. Scaling the variable is a good choice, and accepting scientific notation (what's difficult to me is to transform power to millions or billions in mind) is also acceptable.

              Comment


              • #8
                I think this is a problem, not a feature. Indeed, I just encountered it. I am estimating 4 models. I want to know which one has the lowest BIC (because journal editors will not let me have the space needed to discuss all four models). I run -estimates stats-. It tells me the BIC for Model 1 is 6.03e+07, while for Model 2 it is 6.03e+07, and for Model 3 it is 6.03e+07, and for Model 4 it is 6.03e+07. This is unhelpful. How can we turn off scientific notation (at least for commands like estimates) so we can see the rest of the digits so we, as analysts, can decide how much weight to give any differences that are revealed?

                Comment


                • #9
                  Well, for the output of -estat IC-, you can control the display format, indirectly, as follows:

                  Code:
                  regression command
                  estat ic
                  matrix M = r(S)
                  display %10.0f M[1, "BIC"]

                  Comment


                  • #10
                    Originally posted by Clyde Schechter View Post
                    Well, for the output of -estat IC-, you can control the display format, indirectly
                    Hi Clyde,

                    That is helpful. Thanks!
                    Last edited by Samuel R. Lucas; 29 Feb 2024, 15:37. Reason: Fixing typo

                    Comment

                    Working...
                    X