BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Orchidn
Fluorite | Level 6
Hi,
I am not sure how to round the descriptives to 2 decimal places. Any help would be appreciated.
Thanks!
1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

Send the output to a data set an use one of the proc reports such as Print, Report or Tabulate to display the values where you can set the display formats would likely be the best approach. Add statements such as

ODS OUTPUT tablename= wanteddatasetname;

Table name would likely be CROSSTABS if doing two-way frequencies, ONEWAY if single , CHISQ or CHISQ1 if doing chi-square tests.

 

Or you can run your code preceded with ODS Trace on; prior to the procedure to get a listing of tables generated. Don't forget to use ODS Trace off; afterwards.

 

Otherwise you have to work with Proc Template to modify the displayed tables layouts and that is usually way more work than it is worth.

View solution in original post

3 REPLIES 3
ballardw
Super User

Send the output to a data set an use one of the proc reports such as Print, Report or Tabulate to display the values where you can set the display formats would likely be the best approach. Add statements such as

ODS OUTPUT tablename= wanteddatasetname;

Table name would likely be CROSSTABS if doing two-way frequencies, ONEWAY if single , CHISQ or CHISQ1 if doing chi-square tests.

 

Or you can run your code preceded with ODS Trace on; prior to the procedure to get a listing of tables generated. Don't forget to use ODS Trace off; afterwards.

 

Otherwise you have to work with Proc Template to modify the displayed tables layouts and that is usually way more work than it is worth.

Orchidn
Fluorite | Level 6
Thank you so much! It worked, but there are still variables which were mot converted to 2 digits (the ones that are by default in the crosstab).
ballardw
Super User

@Orchidn wrote:
Thank you so much! It worked, but there are still variables which were mot converted to 2 digits (the ones that are by default in the crosstab).

The table won't change the number of decimals though the number displayed may vary from the table output. You specify that in Proc Print, Report or tabulate. Or you could use Proc DATASETS or a data step (inefficient) to assign formats to specific variables.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 3 replies
  • 1363 views
  • 1 like
  • 2 in conversation