home *** CD-ROM | disk | FTP | other *** search
- Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!darwin.sura.net!paladin.american.edu!auvm!PHPDLS1.EM.CDC.GOV!RJF2
- Encoding: 49 TEXT
- X-Mailer: Microsoft Mail V3.0
- Message-ID: <2B4BB285@router.em.cdc.gov>
- Newsgroups: bit.listserv.sas-l
- Date: Thu, 7 Jan 1993 08:33:00 EST
- Reply-To: rjf2@PHPDLS1.EM.CDC.GOV
- Sender: "SAS(r) Discussion" <SAS-L@UGA.BITNET>
- From: rjf2@PHPDLS1.EM.CDC.GOV
- Subject: discard superfluous observations *HOW*?
- Comments: To: SAS-L@uga.cc.uga.edu
- Lines: 45
-
- content : Response
- summary : discarding excess obs
- rlse/platform: V6.07 / MVS
- Ron Fehd : SMTP:BitNet: <rjf2@phpdls1.em.cdc.gov>
- Centers for Disease Control
- 1600 Clifton Rd MS:G25 FAX : 404/639-1778
- Atlanta, GA 30333 USA phone: 404/639-1707
- ????????????????????????????????????????????????????????????????????????
- From: Patrick Haggard <ph@PHYSIOLOGY.OXFORD.AC.UK>
- Subject: discard superfluous observations *HOW*?
- I have some data containing between n and m observations in each
- of C conditions. I would like to have exactly n observations in
- each condition, so that my design is balanced: I'm fairly happy that
- discarding the excess observations shouldn't change things too much.
- My question: can anyone suggest a way to discard the excess
- observations in a SAS data step, and to number the remaining
- observations 1...n for each condition.
- Thanks
- --------------------------------------------------------------------------
- Patrick Haggard Email (WORLD): ph@physiol.ox.ac.uk
- University Laboratory of Physiology Email (JANET): ph@uk.ac.ox.physiol
- Parks Road, Tel. (0865) 272116
- Oxford, OX1 3PT Fax. (0865) 272469
- England
- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- ooooooooh, getting rid of extra data!?!?!? what a shame, once you have spent
- the money to collect. really good stuff, that data.
-
- you'll need a counter and retain statement:
-
- %LET HOW_MANY = 3;
-
- /*if not SORTED then:*/
- proc SORT;
- by ID_Var;
-
- DATA OBS_EQ_&HOWMANY.;
- set <something>;
- retain Counter 1;
- by ID_Var;
- if first.ID_Var then Counter = 1;
- else Counter + 1;
- if Counter le &HOW_MANY. then output;
-
- endSAS; happy crunching!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!
-