Recoding new sequence variable from continuous time variable
Posted: Tue Dec 10, 2019 11:39 am
Hello all and thank you in advance for any advice.
I have a continuous time variable ('visdy', +/- 0, representing days from 'baseline' intake in a longitudinal study). Generally, participants were re-tested annually but there may be substantial variation of precise testing time.
I want to compute a 'occasion' variable (starting with 1) to categorize baseline and follow up visits. There is currently a 'sequence' variable that was supposed to represent this, but has many errors (approximately 10,000), becuase this database was formed from multiple studies that predated the primary one. So, for one participant (subjid001) you may have three 'sequence = 1' because they had 2 visits (visdy = -365, -650, for example) before the technical 'baseline visit' (visdy = 0), which were all entered as '1' in the initial databases.
Is there a way to recode a new variable based on the ascending values ('visdy') per participant ('subjidxx')?
Thank you very much!
I have a continuous time variable ('visdy', +/- 0, representing days from 'baseline' intake in a longitudinal study). Generally, participants were re-tested annually but there may be substantial variation of precise testing time.
I want to compute a 'occasion' variable (starting with 1) to categorize baseline and follow up visits. There is currently a 'sequence' variable that was supposed to represent this, but has many errors (approximately 10,000), becuase this database was formed from multiple studies that predated the primary one. So, for one participant (subjid001) you may have three 'sequence = 1' because they had 2 visits (visdy = -365, -650, for example) before the technical 'baseline visit' (visdy = 0), which were all entered as '1' in the initial databases.
Is there a way to recode a new variable based on the ascending values ('visdy') per participant ('subjidxx')?
Thank you very much!