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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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