Dear List Subscribers, I am working on the following problem and was wondering if there is some command or set of commands to solve it: Thank you in advance, Eric
1. The dataset Cancer0 may have multiple dates of treatment (DATE) for each patient (ID) with a given disease (SITE). Create a new dataset by keeping only the record with earliest treatment date for each patient and disease site. Dataset: Cancer0 OBS ID SEX AGE DODX SITE DATE DOSE FRAC 1 1001 M 60 09NOV1986 LUNG 03JAN1987 5000 20 2 1001 M 60 09NOV1986 LUNG 03JAN1987 5000 20 3 1002 F 58 07JUN1993 BREAST 03FEB1994 4000 16 4 1002 F 58 07JUN1993 BREAST 05MAR1994 1000 5 5 1003 M 63 11OCT1990 LUNG 15DEC1990 3000 25 6 1003 M 63 11OCT1990 LUNG 18FEB1991 800 5 7 1003 M 59 24MAR1986 SKIN 23AUG1987 200 1 8 1004 F 48 30JUL1995 LARYNX 22SEP1995 3500 25 [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.