Announcement

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

  • Curious results with "table" command in version 18

    Unexpected handling of large integers, and is not obviously (to me) a numerical precision or data storage issue.

    In this example I generate a data set with 10 observations, variable x has values 1-7 for observations 1-7, and observations 8-10 have very large integers. Version 18 "table" command knows they are there but does not display them.

    Wondering if anyone knows why this is happening, and issue another warning for users about large integers in Stata.

    Code:
    clear
    set obs 10
    gen long x=_n
    replace x=99999993 in 8
    replace x=99999994 in 9
    replace x=99999996 in 10
    version 16 : table x , row
    version 18 : table x
    * the total is 8, not 10 as reported
    * (but it should be 10)
    clear
    set obs 10
    set type double
    gen x=_n
    replace x=99999993 in 8
    replace x=99999994 in 9
    replace x=99999996 in 10
    format x %20.0g
    version 16 : table x , row
    version 18 : table x
    * the total is 8, not 10 as reported
    * (but it should be 10)

    Code:
    . version 16 : table x , row 
    
    ----------------------
            x |      Freq.
    ----------+-----------
            1 |          1
            2 |          1
            3 |          1
            4 |          1
            5 |          1
            6 |          1
            7 |          1
     99999993 |          1
     99999994 |          1
     99999996 |          1
              | 
        Total |         10
    ----------------------

    Code:
    . version 18 : table x 
    
    ------------------------
                |  Frequency
    ------------+-----------
    x           |           
      1         |          1
      2         |          1
      3         |          1
      4         |          1
      5         |          1
      6         |          1
      7         |          1
      100000000 |          1
      Total     |         10
    ------------------------
    
    . * the total is 8, not 10 as reported
    . * (but it should be 10)

  • #2
    FWIW I get the same with my Stata 18 MP4, Windows 11.

    Comment


    • #3
      Looks like a bug. You should report this to Technical Services: https://www.stata.com/support/tech-support/contact/

      Comment


      • #4
        This is a bug, thank you for the reproducible example. We hope to have this fixed in a future update to Stata 17 and Stata 18.

        Comment


        • #5
          The Stata 18 update on 04apr2024 fixes this. The fix for this in Stata 17 will be in its next update.

          Comment

          Working...
          X