Announcement

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

  • Turn off scientific notation in xtsum-Output?

    Hello,

    I am currently struggling to get a non-scientific notation in my results when I run the xtsum command.
    The variable I am concerned with is population size, which has values up to 1337704960.
    I already changed the storing format, so when I browse the dataset, the numbers are displayed the way I want them. But my results window then shows the following:



    xtsum popsize


    Variable | Mean Std. Dev. Min Max | Observations
    ----------------------------------------------------------------------------------------------------------
    popsize overall | 3.66e+07 1.42e+08 283752 1.34e+09 | N = 2350
    between | 1.25e+08 604484.7 1.16e+09 | n = 88
    within | 1.69e+07 -1.92e+08 2.15e+08 | T-bar = 26.7045



    I tried fixing the problem with cformat(), which does not work with xtsum.

    How can I get the numbers in the output to be displayed in non-scientific format? I read through all the related forum topics I could find, but could not find a solution for my specific problem.
    I would really appreciate any help on that.

    Kind regards
    Annika






  • #2
    You could always do something like

    gen popsizem = popsize/1000000

    Output in general may be more legible if you rescale variables that have huge values, e.g. use income in thousands of dollars rather than income in dollars.
    -------------------------------------------
    Richard Williams, Notre Dame Dept of Sociology
    Stata Version: 17.0 MP (2 processor)

    EMAIL: [email protected]
    WWW: https://www3.nd.edu/~rwilliam

    Comment


    • #3
      Dear Richard,

      thanks for your reply!

      You are right, probably displaying population size in millions is a better idea than showing the whole number, so I think I'll do it like that.

      If anyone has a solution for my initial problem, I am still interested so let me know

      Regards
      Annika

      Comment


      • #4
        Hi Annika,

        I use -fsum- in Stata 14.2. It could obtain non-scientific notations. I hope this helps you.

        Code:
        . sum ho_income_plus_wage - ho_income_plus_interest
        
            Variable |        Obs        Mean    Std. Dev.       Min        Max
        -------------+---------------------------------------------------------
        ho_income~ge |      3,365     2139863    1.35e+07          0   2.00e+08
        ho_income_~f |        822     1423440     8608755     -30000   1.00e+08
        ho_income~se |     10,026    119.0736    1669.276          0      72000
        ho_income_~d |        891    2111.237    11317.97          0     300050
        ho_income_~t |      9,969    59.94684    3243.713          0     300000
        
        . fsum ho_income_plus_wage - ho_income_plus_interest
        
                         Variable |        N     Mean       SD      Min      Max                                                                                                                              
        --------------------------+---------------------------------------------
              ho_income_plus_wage |     3365 2.14e+06 1.35e+07     0.00 2.00e+08  
              ho_income_plus_self |      822 1.42e+06 8.61e+06-3.00e+04 1.00e+08  
         ho_income_plus_renthouse |    10026   119.07  1669.28     0.00 72000.00  
          ho_income_plus_rentland |      891  2111.24 11317.97     0.00 3.00e+05  
          ho_income_plus_interest |     9969    59.95  3243.71     0.00 3.00e+05  
        
        . fsum ho_income_plus_wage - ho_income_plus_interest, format(%15.0f)
        
                         Variable |              N           Mean             SD            Min            Max                                                                                                                                          
        >                                                                         
        --------------------------+---------------------------------------------------------------------------
              ho_income_plus_wage |           3365        2139863       13462554              0      200002992  
              ho_income_plus_self |            822        1423440        8608755         -30000      100000000  
         ho_income_plus_renthouse |          10026            119           1669              0          72000  
          ho_income_plus_rentland |            891           2111          11318              0         300050  
          ho_income_plus_interest |           9969             60           3244              0         300000
        Kind regards,
        Mengyao

        Comment

        Working...
        X