SPSS Statistics

SPSS Statistics

Your hub for statistical analysis, data management, and data documentation. Connect, learn, and share with your peers! 

 View Only
  • 1.  Rounding numbers in Viewer Tables

    Posted Wed April 20, 2022 03:15 PM

    Hi, I have this syntax:

    DATA LIST FREE /PESO (F) VAR1 (A2).

    BEGIN DATA

    115 A

    85 B

    END DATA.

    DATASET NAME TESTE.

    WEIGHT BY PESO.

    CTABLES

    /VLABELS VARIABLES=VAR1 DISPLAY=LABEL

    /TABLE VAR1 [COUNT F40.0, COLPCT.COUNT PCT40.1]

    /CATEGORIES VARIABLES=VAR1 ORDER=A KEY=VALUE EMPTY=EXCLUDE

    /CRITERIA CILEVEL=95.

    CTABLES

    /VLABELS VARIABLES=VAR1 DISPLAY=LABEL

    /TABLE VAR1 [COUNT F40.0, COLPCT.COUNT PCT40.0]

    /CATEGORIES VARIABLES=VAR1 ORDER=A KEY=VALUE EMPTY=EXCLUDE

    /CRITERIA CILEVEL=95.

    Notice that 57.5% is rounded to 57% instead of the expected 58%.

    57.5% is represented in SPSS Statistics as 57,49999999999999% and if you use RND function in the data editor you got (correctly) 58% (thanks to Fuzzbit). But we got a different behavior in Output Viewer.

    IBM support told me that this is the designed behavior!!!!

    Do you agree with that?

    Show data editor and output viewer use the same algorithm when rounding numbers???






    #SPSSStatistics
    #Support
    #SupportMigration


  • 2.  RE: Rounding numbers in Viewer Tables

    Posted Wed April 20, 2022 04:51 PM

    Hi Support Member'Umbra​ 

    I see you've had discussions with Support in Case TS009052351. In that case you were told that the Pivot table object was using HALF_EVEN rounding. Upon further review we see that this is incorrect. IBM SPSS Statistics is using HALF_UP rounding for positive numbers and HALF_DOWN rounding for negative numbers.

     

    Add to this that the underlying value above is 57.4999999999999998, whereas the pivot table editor is showing 57.500000.

     

    A defect has been reported to IBM SPSS Statistics development and already there is a code change in place for the next release to have the pivot table editor more accurately show the underlying stored value and thus better match the displayed value and rounding method.

     

    https://www.ibm.com/support/pages/apar/PH45804

     

    I hope this helps,

     

    Support Member​ 

     






    #SPSSStatistics
    #Support
    #SupportMigration


  • 3.  RE: Rounding numbers in Viewer Tables

    Posted Wed April 20, 2022 05:39 PM

    Hi David,

    Thank you very much!!!

    I was honestly disappointed with support. Was there a language barrier issue? Maybe I wasn't myself very clear.

    Well, I am happy now that this issue is considered by IBM.

    Also, your link is broken, and I would like to subscribe to this APAR. Can you send me the link again?

    Regards,

    George






    #SPSSStatistics
    #Support
    #SupportMigration


  • 4.  RE: Rounding numbers in Viewer Tables

    Posted Wed April 20, 2022 06:07 PM

    The APAR takes 24-48 hours to publish an become visible to the public. This link is correct https://www.ibm.com/support/pages/apar/PH45804






    #SPSSStatistics
    #Support
    #SupportMigration


  • 5.  RE: Rounding numbers in Viewer Tables

    Posted Wed April 20, 2022 06:19 PM