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

📢

ANNOUNCEMENT

The early bird rate has been extended! Register by March 18 for just $695 - $100 off the standard rate.

 

Check out the agenda and get ready for a jam-packed event featuring workshops, super demos, breakout sessions, roundtables, inspiring keynotes and incredible networking events. 

 

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