Announcement

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

  • How to change display of scientific notation of summary statistics to nummeric?

    Stata 15.1

    I am attempting to create a descriptive statistics table for my thesis. However, I found that variables with large numbers are displayed using the scientific notation.
    In my attempt to change it, I read many FAQ's and other discussions about this problem, but none of these options seemed to work for me.

    The data type of the variables is
    Code:
    double
    , please see below.

    Code:
    sum var1
    
        Variable |        Obs        Mean    Std. Dev.       Min        Max
    -------------+---------------------------------------------------------
          var1 |     12,286    1.18e+09    2.21e+10   .0223229   7.71e+11
    
    format var1 %24.0f
    
    sum var1
    
        Variable |        Obs        Mean    Std. Dev.       Min        Max
    -------------+---------------------------------------------------------
          var1 |     12,286    1.18e+09    2.21e+10   .0223229   7.71e+11
    
    recast float var1, force
    var1:  12072 values changed
    
    sum var1
    
        Variable |        Obs        Mean    Std. Dev.       Min        Max
    -------------+---------------------------------------------------------
          var1 |     12,286    1.18e+09    2.21e+10   .0223229   7.71e+11
    I saw in a reply by Jorrit on a similar question to string the variable, however in that case I am unable to compute summary statistics, right? https://www.statalist.org/forums/for...tific-notation I cannot test this because I get the following message:
    Code:
    tostring var1, gen(var1s) format("%17.0f")
    var1 cannot be converted reversibly; no generate
    Thanks in advance.

    Kind regards,
    Stan

  • #2
    I would change the units to billions. Your tastes may differ but it’s hard for me to imagine practical, scientific or statistical meaning to a display of more than 6 or 8 digits.

    Comment


    • #3
      Thanks Nick! That is indeed a useful tip I did not think about. It will make some variables really small but overall easier for interpretation. Moreover, your observation about the numbers and its size made me think and I found that I made some crucial mistakes while creating the variables... Thank you for that as well!

      Comment


      • #4
        Or ... use logarithms.

        Comment

        Working...
        X