Hello all,
I have a quick question, and it might be straightforward. (However, I could not figure it out in an efficient way)
My data has STATEID, YEAR, TREATMENT, and other covariates. What I wanted to do was to create a relative year. So, first, I wanted to create a variable that includes only the first start year of the treatment.
For example, "GA" is treated from 2000 through 2020, but "FL" is treated from 2005 through 2018. Then, the new treatment variable for GA should be only equal to 1 if the year is 2000 and 2005 for FL (0 for all other years).
May I ask how I can solve this problem?
Thank you!
I have a quick question, and it might be straightforward. (However, I could not figure it out in an efficient way)
My data has STATEID, YEAR, TREATMENT, and other covariates. What I wanted to do was to create a relative year. So, first, I wanted to create a variable that includes only the first start year of the treatment.
For example, "GA" is treated from 2000 through 2020, but "FL" is treated from 2005 through 2018. Then, the new treatment variable for GA should be only equal to 1 if the year is 2000 and 2005 for FL (0 for all other years).
May I ask how I can solve this problem?
Thank you!
Comment