Date: Tue, 21 Dec 2010 09:27:03 -0600
Reply-To: Joe Matise <snoopy369@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Joe Matise <snoopy369@GMAIL.COM>
Subject: Re: what's wrong with proc means?
In-Reply-To: <000401cba123$4efb7220$ecf25660$@com>
Content-Type: text/plain; charset=ISO-8859-1
Max, in the TYPE=0 summary line, there is no value for chol; therefore, it
is missing. You have formatted missing to 'Missing'; therefore it displays
that way. SAS is doing exactly what you asked it to.
-Joe
On Tue, Dec 21, 2010 at 9:25 AM, bbser 2009 <bbser2009@gmail.com> wrote:
> Thanks, Joe. But I do not fully understand what you said.
> My point is: In either case, it would make much more sense that SAS could
> have replaced the "Missing" by a blank on the first line (the grand mean
> line).
>
> I might miss something; but this way of SAS presenting data just makes me
> feel wrong about it.
>
>
>
> Max
>
>
>
> *From:* Joe Matise [mailto:snoopy369@gmail.com]
> *Sent:* December-21-10 10:12 AM
> *To:* bbser 2009
> *Cc:* SAS-L@listserv.uga.edu
> *Subject:* Re: what's wrong with proc means?
>
>
>
> The _TYPE_ 0 line is the summary line. You are seeing both TYPE=chol and
> TYPE=(), which is the overall summary. If you want to eliminate it, you can
> use the various WAYs options, or specify the TYPEs directly.
>
> -Joe
>
> On Tue, Dec 21, 2010 at 8:58 AM, bbser 2009 <bbser2009@gmail.com> wrote:
>
> Greetings!
>
> Running the code below, I ended up with the output data set like this:
>
> chol _TYPE_ _FREQ_ ...
> Missing 0 11
> Low 1 6
> High 1 5
>
> Notice the "grand mean" line starts with "Missing". Why?
>
> If you change the class statement in the proc means below to this one:
>
> class chol/missing;
>
> Then there are two lines led by "Missing" like below. Why again?
>
> chol _TYPE_ _FREQ_ ...
> Missing 0 15
> Missing 1 4
> Low 1 6
> High 1 5
>
> Thank you very much.
>
> Max
>
> ---------- code -------------------
>
> data blood;
> input subject rbc wbc chol;
> cards;
> 1 7.4 7710 258
> 2 4.7 6560 .
> 3 7.53 5690 184
> 4 6.85 6680 .
> 5 7.72 . 187
> 6 3.69 6140 142
> 7 4.78 6550 290
> 8 4.96 5200 151
> 9 5.66 . 311
> 10 5.55 7710 .
> 11 5.62 . 152
> 12 5.85 7410 241
> 13 4.37 5780 .
> 14 6.94 5590 152
> 15 6.03 6520 217
> ;
> *proc print data=blood;
> *run;
>
> proc format;
> value chol_group
> low -< 200 = 'Low'
> 200 - high = 'High'
> .="Missing";
> run;
>
> title "proc means, output data set, class Chol/missing;";
> proc means data=blood mean maxdec=1 noprint;
> class Chol;
> format Chol chol_group.;
> var RBC WBC;
> output out=temp
> mean= / autoname;
> run;
>
> proc print data=temp noobs;
> run;
>
>
>
|