Hi everyone,
I was creating a statistical report and wanted to have a p-value with 3 digits.
I got p=0.0501, but if I rounded it to 0.001 then I would have a p=0.05. How can I keep the last zero?
I used compress or compbl to make it into a string, but they did not work.
Any suggestions?
Thanks.
@data_null and @ballardw, thanks for the quick reply!
Just one more question. If I want to put "0.050" in a string, for example I may try to use "call symput" to make a &pvalue=0.050, then how can I do?
Thanks again!
PUT function
For most purposes assigning a format with the appropriate number of decimal points will display as you want. I would suggest an f5.3. The internal storage of the value doesn't change just the display.
An example:
data _null_;
file print;
x = 0.05;
put x f6.3;
run;
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.
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.