Announcement

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

  • Troubles with thousands separators

    Hi all,

    I have some troubles making a table of a simple variable.
    In the same table output, Stata put sometimes thousands separators and sometimes there is no separator at all.
    Here is an example :
    ----------------------
    REGION | Freq.
    ----------+-----------
    1 | 144.832
    2 | 136.664
    3 | 85.348
    4 | 322.935
    11 | 4310713
    21 | 381.822
    22 | 530.785
    23 | 536.229
    24 | 724.340
    25 | 391.163
    26 | 446.293
    31 | 1223612
    41 | 647.813
    ...

    As you can see lines 11 and 31 got no separators.
    I don’t understand how and why ...

    Thanks
    Aurel

  • #2
    I don't perceive what command this output was generated by. It may or may not be something you can control. But if it is a command that relies on the display format of the variable, or where there is a format option you can specify, you have to make sure that your format's total width is large enough to accommodate all of the digits as well as the separators. It is not a coincidence that the two observations that got no separator are the ones that have 7 digits. When you have a 7 digit number, you need a format width of at least 9 (7 + 2 separators). So a display format like (%9.0fc) should work, but anything smaller will lead to the problem you see. And, in case your data set contains even larger numbers that you haven't encountered yet, it wouldn't hurt to do something even larger just to be safe.

    Comment


    • #3
      Welcome to the Stata Forum / Statalist.

      I recommend you take a look at the FAQ, precisely on how to share data and post a question so as to entice helpful replies.

      That said, I shan't be a problem with Stata at all.

      You may wish to - describe - as well as - summarize, detail - your variable in order to show a detailed information about the variable.

      P.S.: Crossed with Clyde's reply.
      Best regards,

      Marcos

      Comment


      • #4
        I tried with a 9.0 format and it is exactly what I was looking for
        Now I use the command : "table variable ,format(%9.0f)"
        Thanks a lot for your help

        Sorry but I cant find how to close this thread
        Last edited by Aurel Guerin; 26 Jun 2017, 08:53.

        Comment

        Working...
        X