Date: Fri, 5 Jun 2009 06:32:56 -0500
Reply-To: "Data _null_;" <iebupdte@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Data _null_;" <iebupdte@GMAIL.COM>
Subject: Re: output ret to file
In-Reply-To: <6716d5d0906031757m39607eao80a5d78543dfef0f@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1
I wish it were as easy as naming the statistics on the PROC but as you
now know the data set you desire cannot be had directly from
means/summary.
I use this method to I get the default style "_STAT_" data set with
the extra statistic using fairly little effort. The data step to
combine the data usually contains other "needed" activities, like
creating an order variable for the _STAT_.
proc means data=t1 noprint;
output out=opt;
output out=median median=;
run;
data stats;
set opt(in=in1) median(in=in2);
if in2 then _stat_ = 'MEDIAN';
run;
On 6/3/09, Jeff <zhujp98@gmail.com> wrote:
> data t1;
> input v1 v2 v3;
> cards;
> 1 2 3
> 3 4 5
> 8 9 .
> 2 8 7
> 8 . .
> ;
> run;
> proc means data=t1 mean median;
> var _all_;
> output out=opt;
> run;
>
> In this way the opt contians:
> _stat_ v1 v2 v3
> n -------------------
> min ------------
> max-----------
> mean----------
> std---------------
>
> I also want opt to include medians for all variables.
> The expect result should like
>
> _stat_ v1 v2 v3
> mean
> median
>
> how can I do that?
> Thanks,
> Jeff
>