@PGStats, the code works fine, but I noticed that if the first visit is a negative, the code fails to meet the rules. For example, in the data set below. Patient 4 meets the rules, but has a negative first visit. Data Diagnose;
Input @1 Patient_No $2.
@3 Date MMDDYY10.
@14 Visit_No $2.
@16 Outcome $12.;
Format Date MMDDYY10.;
Datalines;
1 10/21/2000 1 Positive
1 10/25/2000 2 Positive
1 11/01/2000 3 Negative
1 05/28/2001 4 Negative
2 11/22/2000 1 Positive
2 11/29/2000 2 Positive
2 12/28/2000 3 Positive
2 06/28/2001 4 Low positive
2 10/29/2001 5 Negative
3 12/12/2000 1 Positive
3 12/29/2000 2 Positive
3 02/21/2001 3 Positive
3 07/12/2001 4 Negative
3 08/29/2001 5 Positive
4 10/21/2000 1 Negative
4 11/25/2001 2 Positive
4 12/01/2001 3 Positive
4 06/28/2002 4 Negative
4 10/26/2002 5 Negative
;
... View more