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 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 706 views
  • 1 like
  • 2 in conversation