How do I round off in proc tabulate?

Reply
N/A
Posts: 1

How do I round off in proc tabulate?

I am using proc tabulate to generate a table containing mean and standard deviation for some variables. It returns a table where the values are given with two significant figures. Is there any way I can round off these values to the nearest whole number instead?

Code used:

proc tabulate data=sved.rank4 missing order=formatted;

where MMSEny ne .;

class diagnosid overall;

var diagnosage MMSEny ab42ny ttauny ptauny;

tables diagnosage MMSEny ab42ny ttauny ptauny,

diagnosid=''*(mean stddev)

overall=''*(mean stddev);

format diagnosid diagnosid_. overall overall_.;

run

;

/Christoffer

Super User
Posts: 9,687

Re: How do I round off in proc tabulate?

proc tabulate data=sved.rank4 missing order=formatted;

where MMSEny ne .;

class diagnosid overall;

var diagnosage MMSEny ab42ny ttauny ptauny;

tables diagnosage MMSEny ab42ny ttauny ptauny,

diagnosid=''*(mean*f=best8.0 stddev)

overall=''*(mean stddev);

format diagnosid diagnosid_. overall overall_.;

run

Valued Guide
Posts: 3,208

Re: How do I round off in proc tabulate?

The best format will show as most possible digits.

Do you want to round off at your wishes use a proper format for that according your wish

---->-- ja karman --<-----
Super User
Posts: 10,538

Re: How do I round off in proc tabulate?

You don't mention the range of values so I'm guessing as to how large to make the format. If you need more digits increase the 6 to the number needed, up to 32 any way.

diagnosid=''*(mean*f=f6.0 stddev*f=f6.0)

overall=''*(mean*f=f6.0 stddev*f=f6.0);

Ask a Question
Discussion stats
  • 3 replies
  • 469 views
  • 3 likes
  • 4 in conversation