SAS: PROC UNIVARIATE: Output trimmed mean to datas

2019-03-02 08:16发布

问题:

I'm doing the following the output the mean to a datset:

PROC UNIVARIATE DATA=have trimmed=0.05;
VAR age;
by sex;
output out=outputstats mean=theMean;
run;
proc print; run;

How can I output the trimmed mean? I can't find the keyword to request so I can select it.

回答1:

ODS OUTPUT to the rescue. Use ODS TRACE ON; to find the name.

proc sort data=sashelp.class out=have;
by sex;

run;

ods trace on;
PROC UNIVARIATE DATA=have trimmed=0.05;
VAR age;
by sex;
ods output TrimmedMeans=trimmedMeans;
run;
ods trace off;


标签: sas