I'm trying to create a data set from an original data set. But I only want to keep data for participants that had all 3 visits and who were not taking any medication at the first visit (visit=1). Meds: 1= taking medication; 0= not taking medication. Here is an example of the data (called exercise) for reference. ID visit meds time 1 1 1 5 1 2 1 4 2 1 0 6 2 2 1 8 2 3 1 5 3 1 1 9 4 1 0 3 4 2 0 4 4 3 0 3 5 1 1 3 5 2 0 8 5 3 0 5 6 1 1 7 6 2 1 9 7 1 0 6 7 2 0 5 7 3 0 8
... View more