turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- SAS Procedures
- /
- Percentages in Proc Freq do not sum to 100

Topic Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

12-09-2009 09:37 AM

Is there any way to force Proc Freq to round in such a way that percentages always sum to 100? I have been getting a lot of sums of 99.9 or even as low as 99.7, and that just looks bad on a report.

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to lhatbrn

12-09-2009 09:51 AM

Could this be related to the famous numeric precision question?

http://support.sas.com/techsup/technote/ts654.pdf

http://support.sas.com/documentation/cdl/en/lrcon/61722/HTML/default/a000695157.htm

http://support.sas.com/techsup/technote/ts230.html

The simplest way (and I'm sure you've already though of that) would be to round the sum to the nearest integer.

Cheers from Portugal

Daniel Santos @ www.cgd.pt

http://support.sas.com/techsup/technote/ts654.pdf

http://support.sas.com/documentation/cdl/en/lrcon/61722/HTML/default/a000695157.htm

http://support.sas.com/techsup/technote/ts230.html

The simplest way (and I'm sure you've already though of that) would be to round the sum to the nearest integer.

Cheers from Portugal

Daniel Santos @ www.cgd.pt

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to lhatbrn

12-10-2009 02:12 AM

If you give it a bit of thought: It's actually correct that the detail numbers are not always summing up to 100% (the total line though will be 100%).

Let's say you have 4 detail percentages where the exact values are:

24.44,24.44,24.44,26.68

You want now these values listed with only one decimal. You would most likely use arithmetic rounding:

24.4,24.4,24.4,26.7

And well: This doesn't sum up to 100%. But where would you "cheat" and use another rounding algorithm?

I used to have a boss who never understood this. It was a pain!

Best you can do is add a footnote where you explain why the detail numbers might not add up to 100%.

HTH

Patrick

Let's say you have 4 detail percentages where the exact values are:

24.44,24.44,24.44,26.68

You want now these values listed with only one decimal. You would most likely use arithmetic rounding:

24.4,24.4,24.4,26.7

And well: This doesn't sum up to 100%. But where would you "cheat" and use another rounding algorithm?

I used to have a boss who never understood this. It was a pain!

Best you can do is add a footnote where you explain why the detail numbers might not add up to 100%.

HTH

Patrick