Anxious
Anxious

Reputation: 1

PROC MEANS output as table

I'm trying to export quartile information on a grouped dataset as a dataset in SAS but when I run this code my output is a table with the correct information displayed but the dataset WORK.TOP_1O_PERC is only summary statistics of the set (no quartiles). Does anyone know how I can export this as the CLASS (PDX) and its 25th and 75th percentiles? Thanks!

PROC MEANS DATA=WORK.TOP_10_DX P25 P75;
CLASS PDX;
VAR AmtPaid;
OUTPUT OUT = WORK.TOP_10_PERC;
RUN;

Upvotes: 0

Views: 1303

Answers (2)

whymath
whymath

Reputation: 1394

You can use output statement with <statistics>= options.

PROC MEANS DATA=WORK.TOP_10_DX NOPRINT;
  CLASS PDX;
  VAR AmtPaid;
  OUTPUT OUT = WORK.TOP_10_PERC P25=P25 P75=P75;
RUN;

Compared to ods output, output statement is much faster but less flexible with multiple analysis variables or by statement specified situation.

Upvotes: 0

data _null_
data _null_

Reputation: 9109

I like the STACKODS output that is a data set which is like the default printed output.

proc means data=sashelp.class n p25 p75 stackods;
   ods output summary=summary;
   run;
proc print;
   run;

enter image description here

Upvotes: 4

Related Questions