BookmarkSubscribeRSS Feed
NicolaD
Calcite | Level 5
I'm sure this should be simple and I just don't know the syntax.

I've managed to use proc tabulate to produce tables just the way we need them except that I need to round the N values to the nearest 10 and I'm not sure how to.

My table statement for proc tabulate is this:

table (sex all)*(l7drdays all),wt07*(age all)*pctsum (age all)*wt07 (age all)*n;

and I think I'll just need to add *f ='something' to the end of (age all)*n - I just don't know what the 'something' should be for this formatting. Would really appreciate it if someone could help!

Nicola
2 REPLIES 2
Patrick
Opal | Level 21
Hi
Below the closest I could figure out.
HTH
Patrick


proc format;
picture r10x (round)
low-high = "00000009 D"(mult=0.1 )
;
run;

data have(keep=j);
do j=1 to 5;
x=ceil(ranuni(8)*100);
do i=1 to x;
output;
end;
end;
run;

title1 'unformatted values';
proc tabulate data=have ;
class j;
table j;
run;

title1 'rounded to the next 10';
proc tabulate data=have ;
class j;
table j *f=r10x.;
run;
Peter_C
Rhodochrosite | Level 12
use Patrick's technique, or adapt it, if O is close enough to 0 😉
proc format;
picture r10x (round)
low-high = "00000009O"(mult=0.1 )
;
run;

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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