I'm aware when using the PROC Means procedure that you can round the entries in the resulting table to a certain number of decimal places but is there a way to round them to a certain number of significant figures. If there isn't, is there another procedure for generating summary statistics where this could be specified?
proc means data=sashelp.heart stackodsoutput;
ods output summary=s;
run;
proc print label noobs; format _numeric_ bestd8.7; run;
Look at the D and BestD formats. This would be the easiest way to use them with PROC MEANS I think.
https://blogs.sas.com/content/sgf/2017/05/30/the-best-d-formats-that-you-have-ever-seen/
You can either output the data to a data set (see Examples 2 & 10 in the Documentation) or you could use PROC TABULATE for the same decimal places. However, significant digits are different and that's usually not a fixed rule, if I recall correctly. So it may be easier to output to a data set and then implement your display rules and then use PROC PRINT or REPORT to display the output.
proc means data=sashelp.heart stackodsoutput;
ods output summary=s;
run;
proc print label noobs; format _numeric_ bestd8.7; run;
Look at the D and BestD formats. This would be the easiest way to use them with PROC MEANS I think.
https://blogs.sas.com/content/sgf/2017/05/30/the-best-d-formats-that-you-have-ever-seen/
You could do it with the ODS:
proc means data=sashelp.class n mean std median clm STACKODSOUTPUT;
format age height weight best4.;
label weight="Weight (pounds)";
var age height weight;
ods output Summary=s;
run;
Proc sql;
select
variable,
label,
n,
mean format=best5.,
stdDev format=best6.,
median format=best5.,
lclm format=best5.,
uclm format=best5.
from s;
quit;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.