How can I set the number of decimal places for outputted means in PROC UNIVARIATE?
I can find the option for decimal places for percentiles, but not means.
PROC UNIVARIATE DATA=Data_02_long NORMAL;
CLASS time group;
VAR
Efflux;
HISTOGRAM;
OUTPUT OUT=data_01_output mean=Efflux std=Efflux;
RUN;
PROC PRINT DATA=data_01_output;
RUN;
Thanks.
When you do a PROC PRINT, you can control the decimal places there with a format statement. For example:
format efflux 8.2;
When you do a PROC PRINT, you can control the decimal places there with a format statement. For example:
format efflux 8.2;
Whoops, I may have jumped the gun in accepting this as the solution. Sorry, I want to plot these means using PROC SGPLOT so I need the control the decimal places in the OUTPUT or in the PROC SGPLOT.
PROC SGPLOT data=data_01_output;
series x=time y=Efflux / lineattrs=(thickness=3px) group=group
markers markerattrs=(size=10pt) DATALABEL DATALABELATTRS=(Color=grey Family="Arial" Size=12
Style=Italic Weight=Bold);
yaxis
values=(8 to 12 BY 1) label='Efflux (Mean)'
labelattrs=(size=12pt weight=bold color=gray33)
valueattrs=(size=12pt weight=bold color=gray33)
offsetmin=0 offsetmax=0 grid minor minorcount=1;
xaxis
values=(1 to 3 BY 1) label='Timepoint'
labelattrs=(size=12pt weight=bold color=gray33)
valueattrs=(size=12pt weight=bold color=gray33)
offsetmin=0 offsetmax=0 grid minor minorcount=1;
/* FORMAT timepoint_graph timepoint_graph_.; */
TITLE "Change in Efflux Over Time (Mean)";
/* TITLE2 "PROMIS Pain Intensity Score"; */
footnote "Footnote: CONFIDENTIAL";
RUN;
@_maldini_ wrote:
Whoops, I may have jumped the gun in accepting this as the solution. Sorry, I want to plot these means using PROC SGPLOT so I need the control the decimal places in the OUTPUT or in the PROC SGPLOT.
PROC SGPLOT data=data_01_output; series x=time y=Efflux / lineattrs=(thickness=3px) group=group markers markerattrs=(size=10pt) DATALABEL DATALABELATTRS=(Color=grey Family="Arial" Size=12 Style=Italic Weight=Bold); yaxis values=(8 to 12 BY 1) label='Efflux (Mean)' labelattrs=(size=12pt weight=bold color=gray33) valueattrs=(size=12pt weight=bold color=gray33) offsetmin=0 offsetmax=0 grid minor minorcount=1; xaxis values=(1 to 3 BY 1) label='Timepoint' labelattrs=(size=12pt weight=bold color=gray33) valueattrs=(size=12pt weight=bold color=gray33) offsetmin=0 offsetmax=0 grid minor minorcount=1; /* FORMAT timepoint_graph timepoint_graph_.; */ TITLE "Change in Efflux Over Time (Mean)"; /* TITLE2 "PROMIS Pain Intensity Score"; */ footnote "Footnote: CONFIDENTIAL"; RUN;
I'm not following this at all. You don't have to control the number of decimal places in the output of PROC MEANS/PROC SUMMARY/PROC UNIVARIATE to run PROC SGPLOT.
This is the current graph. I'd like to limit the decimal places to 2.
If all you want is means and standard deviations, you should use PROC MEANS/PROC SUMMARY rather than PROC UNIVARIATE. PROC UNIVARIATE calculates a lot of statistics that you aren't asking for, so its probably inefficient to use for this purpose.
In PROC MEANS, there is a MAXDEC= option to specify the maximum number of decimal places in the output.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.