home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / bit / listserv / sasl / 5091 < prev    next >
Encoding:
Internet Message Format  |  1992-11-18  |  2.5 KB

  1. 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
  2. From: POPPE@SWOV.NL (Frank Poppe)
  3. Newsgroups: bit.listserv.sas-l
  4. Subject: Re: MINID and MAXID
  5. Message-ID: <01GRAYEQV7OW000GFC@swov.nl>
  6. Date: 18 Nov 92 15:47:00 GMT
  7. Sender: "SAS(r) Discussion" <SAS-L@UGA.BITNET>
  8. Reply-To: Frank Poppe <POPPE@SWOV.NL>
  9. Lines: 40
  10. Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
  11. X-Organization: stichting wetenschappelijk onderzoek verkeersveiligheid SWOV
  12. X-Envelope-to: sas-l@AWIIMC12.BITNET
  13. X-VMS-To: IN%"W_URBAN@UNHH.UNH.EDU"
  14. X-VMS-Cc: in%sas,
  15. X-VMS-Cc: POPPE
  16. Comments: To: W_URBAN@UNHH.UNH.EDU
  17.  
  18. From: W_URBAN@UNHH.UNH.EDU
  19. Subject: MINID and MAXID
  20.  
  21. ]   I have really been baffled by TFM under PROC MEANS and the
  22. ]   description of MINID and MAXID.  What I would *like* to do is say
  23. ]
  24. ]        PROC MEANS MIN MINID(ID) MAX MAXID(ID);
  25. ]           VAR {many variables};
  26. ]
  27. ]   where ID is a real id in the dataset.  Now I realize that this has
  28. ]   to be done with the manipulation of the resulting dataset from an
  29. ]   OUTPUT statement; but it looks like one has to specify a new
  30. ]   variable name for each and every minid and maxid for every
  31. ]   original variable.  Is there any way to say "do it for every
  32. ]   variable in the VAR statement?
  33. ]
  34. ]   will@unh.edu
  35.  
  36. You say "do it" but what is *it* ??
  37. I get the impression you want an output dataset with "every variable"
  38. the minimal value, the maximumvalue, and the value of another variable (ID)
  39. from the observation that has the min, resp. the max.
  40. That means four new variables for each single old variable.
  41. That's why you'll have to give new names.
  42.  
  43. SAS might have included an option to have the PROC generate new names
  44. (appending MIN or MAX or MND MXD to the 5 first character of the old names).
  45.  
  46. It is possible to write a macro that finds out which numeric variables are
  47. present in the dataset, and that generates such new names.
  48. (The code becomes complicated when it is nessary to resolve name-conflicts
  49. between the new names...)
  50.  
  51.  
  52. _____________________________________________________________________________
  53.  Frank Poppe             <poppe@swov.nl>                tel:   +31 70 3209323
  54.  Institute for Road Safety Research SWOV                fax:   +31 70 3201261
  55.     ,,,  ,, ,, ,,  .... ,, ,,                           mail:      PO Box 170
  56.    ||,,, || || || :: :: || ||                            2260 AD Leidschendam
  57.    ,,,|~ ||,'|,~  :: :' ||,~                                  the Netherlands
  58.