IALSA / HRS

Shaping data from the Health and Retirement Study.
GNU General Public License v2.0
5 stars 2 forks source link

Creating a new wave variable #10

Open casslbrown opened 7 years ago

casslbrown commented 7 years ago

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?

screen shot 2017-03-16 at 8 36 44 pm