home *** CD-ROM | disk | FTP | other *** search
- Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
- Path: sparky!uunet!paladin.american.edu!auvm!NIHCU.BITNET!HIS
- Message-ID: <SAS-L%92082014263032@UGA.CC.UGA.EDU>
- Newsgroups: bit.listserv.sas-l
- Date: Thu, 20 Aug 1992 14:24:11 EDT
- Reply-To: Howard Schreier <HIS@NIHCU.BITNET>
- Sender: "SAS(r) Discussion" <SAS-L@UGA.BITNET>
- From: Howard Schreier <HIS@NIHCU.BITNET>
- Subject: Re: Subsetting data set
- Lines: 51
-
- CONTENT: Response
- SUMMARY: Check proximity to MIN and MAX dates
- REL/PLTF:
-
- > I was given a data file (ascii) that contains both baseline
- > values and 1-yr follow-up values. Each respondent has
- > multiple records of the same variables except for the date.
- > The only thing that distinguishes between the baseline
- > records and follow-up records is that they are about a year
- > apart. Is there an easy way to separate the baseline data
- > from the one year data? The problem is that there are no
- > fixed no. of records for each respondent. Some have 2
- > records at baseline and 4 at follow-up, 4 at baseline and
- > none at follow-up, 3 at baseline and 2 at follow-up, etc.
- > There is also no specific cut-off date for baseline, ie. the
- > dates overlap. Below is an eg.:
- >
- > ID DATE VAR1 VAR1 VAR3........
- > 101 8/10/90 1 2 3
- > 101 8/11/90 2 2 1
- > 101 8/12/90 1 1 2
- > 102 5/1/91 1 1 3
- > 102 5/3/91 2 3 3
- > 103 8/5/91 3 3 1
- > 103 8/7/91 1 1 1
- > 101 8/4/91 3 3 2
- > 101 8/5/91 2 2 3
- > 103 8/1/92 1 1 1
- > 107 10/1/90 1 2 2
- > 107 10/3/90 2 3 1
- > 102 4/29/92 3 2 1
- > 102 4/30/92 2 2 2
- > 104 6/23/90 3 3 3
- > 104 6/24/90 3 1 2
- > 104 6/26/90 1 2 3
-
- Read everything into a SAS data set (use a date informat for
- DATE and also declare a DATE format for it). Use PROC
- SUMMARY to get MIN, MAX, and RANGE for DATE, for each ID,
- and MERGE these back with original data. Construct some IF
- tests to assign observations to baseline and follow-up. I
- would also check for irregular cases (RANGE statistic not
- close to 365, DATE values not close to either MIN or MAX
- statistic).
-
- /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
- \ Howard Schreier, U.S. Dept. of Commerce, Washington /
- / MVS 5.18 & 6.07 \
- \ Voice: (202) 377-4180 BITNET: HIS@NIHCU /
- / Fax: (202) 377-4614 INTERNET: HIS@CU.NIH.GOV \
- \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
-