- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi all,
below is my data:
And I am using below code:
proc sort data=adsl(keep=trt01pn age); by trt01pn; run;
proc means data=adsl maxdec=2 noprint;
by trt01pn;
var age;
output out=age_ n=n1 mean=mean1 std=std1 median=med min=min1 max=max1;
run;
Getting below result with missing decimal places, what might be the reason for missing decimal places?
How can get values with decimal places?
Thanks,
Adithya
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
YOu can apply a format in a data step with the format statement.
format var 8.2;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I suspect it is a default you have set to view tables.
If you print the data you would likely see the decimals for MEAN1 and STD1, the only variables that might have a decimal.
Or you may need to provide an explicit format when printing.
Why bother with the MAXDEC=2 when using NOPRINT? From the documentation for Proc Means:
MAXDEC=number
specifies the maximum number of decimal places to display the statistics in the printed or displayed output. MAXDEC= has no effect on statistics that are saved in an output data set.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Yes, how I can I get decimal places to my output dataset? where can I change that setting?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
YOu can apply a format in a data step with the format statement.
format var 8.2;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Got it. Thanks!