home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!stanford.edu!bu.edu!olivea!sgigate!sgiblab!swrinde!zaphod.mps.ohio-state.edu!darwin.sura.net!paladin.american.edu!auvm!SWOV.NL!POPPE
- From: POPPE@SWOV.NL (Frank Poppe)
- Newsgroups: bit.listserv.sas-l
- Subject: Re: MINID and MAXID
- Message-ID: <01GRAYEQV7OW000GFC@swov.nl>
- Date: 18 Nov 92 15:47:00 GMT
- Sender: "SAS(r) Discussion" <SAS-L@UGA.BITNET>
- Reply-To: Frank Poppe <POPPE@SWOV.NL>
- Lines: 40
- Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
- X-Organization: stichting wetenschappelijk onderzoek verkeersveiligheid SWOV
- X-Envelope-to: sas-l@AWIIMC12.BITNET
- X-VMS-To: IN%"W_URBAN@UNHH.UNH.EDU"
- X-VMS-Cc: in%sas,
- X-VMS-Cc: POPPE
- Comments: To: W_URBAN@UNHH.UNH.EDU
-
- From: W_URBAN@UNHH.UNH.EDU
- Subject: MINID and MAXID
-
- ] I have really been baffled by TFM under PROC MEANS and the
- ] description of MINID and MAXID. What I would *like* to do is say
- ]
- ] PROC MEANS MIN MINID(ID) MAX MAXID(ID);
- ] VAR {many variables};
- ]
- ] where ID is a real id in the dataset. Now I realize that this has
- ] to be done with the manipulation of the resulting dataset from an
- ] OUTPUT statement; but it looks like one has to specify a new
- ] variable name for each and every minid and maxid for every
- ] original variable. Is there any way to say "do it for every
- ] variable in the VAR statement?
- ]
- ] will@unh.edu
-
- You say "do it" but what is *it* ??
- I get the impression you want an output dataset with "every variable"
- the minimal value, the maximumvalue, and the value of another variable (ID)
- from the observation that has the min, resp. the max.
- That means four new variables for each single old variable.
- That's why you'll have to give new names.
-
- SAS might have included an option to have the PROC generate new names
- (appending MIN or MAX or MND MXD to the 5 first character of the old names).
-
- It is possible to write a macro that finds out which numeric variables are
- present in the dataset, and that generates such new names.
- (The code becomes complicated when it is nessary to resolve name-conflicts
- between the new names...)
-
-
- _____________________________________________________________________________
- Frank Poppe <poppe@swov.nl> tel: +31 70 3209323
- Institute for Road Safety Research SWOV fax: +31 70 3201261
- ,,, ,, ,, ,, .... ,, ,, mail: PO Box 170
- ||,,, || || || :: :: || || 2260 AD Leidschendam
- ,,,|~ ||,'|,~ :: :' ||,~ the Netherlands
-