BookmarkSubscribeRSS Feed
lueryy2000
Calcite | Level 5
Hi,

I ran a proc means procedure to get mean and standard deviation for my data. However, the length for them are 12, eg, mean=0.0578154391, std=0.0245687672. I only want to have 3 decimal places and total length is 5, that is, mean=0.057, std=0.024, and they still have to be numeric. How should I do it? Thank you very much.

Lu
5 REPLIES 5
RickM
Fluorite | Level 6
Try

proc means data = one maxdec=3;
var ...;
run;

Good luck!
lueryy2000
Calcite | Level 5
Sorry I didn't make myself clear. I also used the output statement in proc means prodecure and get a sas dataset: data1 to include the mean and std, I mean how to change the length of mean and std in data1.

Lu
RickM
Fluorite | Level 6
Do you really want to round the values or do you just want to change the format for when they are displayed? You can use proc datasets to change the format of the output dataset.
RickM
Fluorite | Level 6
It also looks like if you use the format statement in proc means the output dataset will inherit the formats for those variables.
lueryy2000
Calcite | Level 5
Thank you very much. Your reply reminded me the round function, by which I can change the decimal place for mean and std. Thanks!

Lu

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 5 replies
  • 2980 views
  • 0 likes
  • 2 in conversation