BookmarkSubscribeRSS Feed
lhatbrn
Calcite | Level 5
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.
2 REPLIES 2
DanielSantos
Barite | Level 11
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
Patrick
Opal | Level 21
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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 1037 views
  • 0 likes
  • 3 in conversation