I want to create a variable containing the days each person was followed up in the study using one date as the reference start date/study commencement date. There is a variable in my data set which has dates on which the participants were examined first and dates for the follow up examinations. The variable which has the dates on which measurements were taken has dates entered in format like this "20050101" which represents the year=2005, month=january and day=1st day of the month. The data has five years of follow up but each person entered the study at different dates and different numbers of hospital visits.
I want to create a variable having number of days each person was followed up and for each visit.