Date: Thu, 19 Jun 2003 10:31:03 -0700
Reply-To: Michelle Jellinghaus <michelle@EMODE.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Michelle Jellinghaus <michelle@EMODE.COM>
Subject: Re: combine incomplete observations by var
Content-Type: text/plain; charset="us-ascii"
This worked beautifully. Thank you very much for taking the time to
answer my post.
I am still trying to figure out *why* it worked, however ;) I hope you
won't mind a few questions.
This is what I have so far; will you let me know if I'm right?
nway: this option removes an observation that contains a column
sum for all rows
missing: I'm not sure what this does here, but it seems to work
sum= in the output statement: this seems to give a sum of all
values in a column by class instead of returning M, STD, etc.
I see the _type_ column, but I don't understand what it is.
Thanks again for your help.
From: Jack Hamilton [mailto:JackHamilton@firsthealth.com]
Sent: Wednesday, June 18, 2003 6:11 PM
To: Michelle Jellinghaus; SAS-L@LISTSERV.UGA.EDU
Subject: Re: [SAS-L] combine incomplete observations by var
If those are all the variables in the data set, you could do something
like this (untested):
proc summary nway missing data=in_dsn;
var p1 p2 p3 p4;
output out=out_dsn (drop=_type_ _freq_)
You could use PROC REPORT instead if you also want a printout at the
Manager, Technical Development
Metrics Department, First Health
West Sacramento, California USA
>>> "Michelle Jellinghaus" <michelle@EMODE.COM> 06/18/2003 5:22 PM >>>
I have a data set that I would like to collapse based on date.
It looks something like this right now:
date p1 p2 p3 p4
4/5/03 40 . . .
4/5/03 . 30 . .
4/5/03 . . 20 .
4/5/03 . . . 10
4/6/03 50 . . .
4/6/03 . 40 . .
4/6/03 . . 40 .
4/6/03 . . . 30
And I'd like it to look something like this:
date p1 p2 p3 p4
4/5/03 40 30 20 10
4/6/03 50 40 40 30
This would provide me with one observation per date, with a complete
values for each variable, ridding the data set of all missing values.
Any ideas would be very much appreciated.