Hello everyone,
I am struggling with a basic recoding process. Basically, I have a variable called working_c19 which takes value 1 if people were working at that time, and 0 otherwise. Now, I want to recode variable so that it is only defined for those who were working at baseline period, January 2020 (variable called workin_bl).
I tried the following, but do not provide me exactly what I want:
But basically, When I have 0 in the baseline period, and 1 in the current period, I obtain 1 in my new generated variable working_c19_adjusted.
I want to have 1 for my new variable only when both contain the value of 1.
Thank you in advance for your help.
Best,
Michael
I am struggling with a basic recoding process. Basically, I have a variable called working_c19 which takes value 1 if people were working at that time, and 0 otherwise. Now, I want to recode variable so that it is only defined for those who were working at baseline period, January 2020 (variable called workin_bl).
I tried the following, but do not provide me exactly what I want:
Code:
egen byte working_c19_adjusted = rowmax(working_bl working_c19)
I want to have 1 for my new variable only when both contain the value of 1.
Thank you in advance for your help.
Best,
Michael

Comment