BookmarkSubscribeRSS Feed
shyam
Calcite | Level 5

Hi,

I computed spearman correlation and output in the table by using following procedure.

Proc Corr Spearman data=mydata outp=corrtable;

var v1-v5;

run;

I want to limit the decimal place (two or three digits after the decimal) in  correlation matrix in output table "corrtable" . Could you sugget me the way to accomplish it.

Thanks,

Shyam

3 REPLIES 3
ballardw
Super User

I wouldn't actually change the value. Use an appropriate format when displaying the values such as:

proc print data=corrtable;

     var v1-v5;

     format v1-v5 f5.3;

run;

to show 3 decimals.

You can make this a default for the output set using Proc datasets to change the default format to the one you want.

shyam
Calcite | Level 5

Thanks Ballardw, However, I would like to change the decimal place in a output table when it output from Proc Corr procedure.


stat_sas
Ammonite | Level 13

You can do it using data step

data corrtable;

  set corrtable(where=(_type_='CORR'));

  format _numeric_ 4.3;

run;

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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