LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (March 2000, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 29 Mar 2000 05:19:47 GMT
Reply-To:     N Yiannakoulias <nwy@GPU.SRV.UALBERTA.CA>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         N Yiannakoulias <nwy@GPU.SRV.UALBERTA.CA>
Organization: University of Alberta
Subject:      selecting controls...help?

Hi all,

Yet another programming task that has me stumped: I have two files -a case file and a control pool:

Case file Control file ID1 DATE1 ID2 DATE2 DATE3 1 1997 1 1994 1995 2 1993 2 1998 1997 3 1995 3 1997 1999 4 1997 4 1999 1999 5 1998 5 1999 1999 6 1993 6 1999 1998 ... 7 1998 1999 n=2500 8 1998 1997 ... n=80 000 (randomly ordered)

I need to match 4 controls to each case. A control is matched to a case if DATE2 and DATE3 are > DATE1. Once a control is successfully matched to a case, it is removed from the pool. The resultant Control file should look like this:

Control file ID2 DATE2 DATE3 MATCH 1 1994 1995 2 2 1998 1997 2 3 1997 1999 2 4 1999 1999 1 5 1999 1999 1 6 1999 1998 1 7 1998 1999 1 8 1998 1997 2 ... n=10 000 (4 controls for each case)

Any suggestions/hints would greatly appreciated,

N


Back to: Top of message | Previous page | Main SAS-L page