Since the psychosocial items (called the leave-behind questionnaire) I am interested in were only given at every second HRS interview I wanted to create a new variable (I've called it lbwave) to indicate what wave of eligibility for the leave-behind questionnaire each year is for the participant based on a flag variable in the HRS data. I've written a section of code that accomplishes this task just as I'd like it to but it is very very slow. Perhaps there is a more efficient way that I'm not seeing?
Since the psychosocial items (called the leave-behind questionnaire) I am interested in were only given at every second HRS interview I wanted to create a new variable (I've called it lbwave) to indicate what wave of eligibility for the leave-behind questionnaire each year is for the participant based on a flag variable in the HRS data. I've written a section of code that accomplishes this task just as I'd like it to but it is very very slow. Perhaps there is a more efficient way that I'm not seeing?