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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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