I have a database of doctor visits. Each case is a visit and the variable "id" allows identification of repeat attendees. I have created a new variable "dup" which numbers the visits of each person in chronological order. (second visit of id=abc123 has value dup=2)
I want to create a new variable (datenext) which shows the date of the person's next visit, based on the variable date of visit (datevisit). For those with dup=0 (unique attendees) datenext will be missing. I want the variable to show date of the visit of the person with the same id but with the value of dup = dup+1. For cases showing the last visit, datenext will be missing.
Many thanks
I want to create a new variable (datenext) which shows the date of the person's next visit, based on the variable date of visit (datevisit). For those with dup=0 (unique attendees) datenext will be missing. I want the variable to show date of the visit of the person with the same id but with the value of dup = dup+1. For cases showing the last visit, datenext will be missing.
Many thanks
Comment