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;

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 1553 views
  • 0 likes
  • 3 in conversation