Thank you for entertaining my question, which I hope is a Recoding question, but since I’ve reached a point of confusion, perhaps it is not.
I have tried a several textbooks, this and other forums, YouTube and some trial and error.
I inherited a data set of ~16,000 people who had medical exams over a 4 year period on a continuous annual enrollment plan.
Specifically, new patients could enroll each year and, if they enrolled in year one, would have one year of follow-up on year 2.
Likewise, if they enrolled in year 2 they would have one year of follow up on year 3
If enrolled in year 3, the would have a year of follow-up on year 4
Similarly, the could have 2 years of follow up if they enrolled in year 1 and subsequent exams in year 2 and year 3 or enrolled in year 2 with subsequent exams in year 3 and year 4.
Finally, they could have 3 years of follow-up if they enrolled in year 1 and had follow-up visits in years 2, 3 and 4.
Column 1/Var0001 = ID
Column 2/Var0002 = Exam Year defined as 1, 2, 3, or 4.
if (Exam.Year=1 & Exam.Year=2) Follow.Up=1.
if (Exam.Year=2 & Exam.Year=3) Follow.Up=1.
if (Exam.Year=3 & Exam.Year=4) Follow.Up=1.
if (Exam.Year=1 & Exam.Year=2 & Exam.Year=3) Follow.Up=2.
if (Exam.Year=2 & Exam.Year=3 & Exam.Year=4) Follow.Up=2.
if (Exam.Year=1 & Exam.Year=2 & Exam.Year=3 & Exam.Year=4) Follow.Up=3.
recode Follow.up (SYSMIS=0).
Where:
1 = 1 Year Follow-up
2 = 2 Year Follow-up
3 = 3 Year Follow-up
If I run this syntax all I get are zero’s so am now at a loss. My syntax ability is “ok” but far from fluent.
Many thanks in advance for any suggestions.
I have tried a several textbooks, this and other forums, YouTube and some trial and error.
I inherited a data set of ~16,000 people who had medical exams over a 4 year period on a continuous annual enrollment plan.
Specifically, new patients could enroll each year and, if they enrolled in year one, would have one year of follow-up on year 2.
Likewise, if they enrolled in year 2 they would have one year of follow up on year 3
If enrolled in year 3, the would have a year of follow-up on year 4
Similarly, the could have 2 years of follow up if they enrolled in year 1 and subsequent exams in year 2 and year 3 or enrolled in year 2 with subsequent exams in year 3 and year 4.
Finally, they could have 3 years of follow-up if they enrolled in year 1 and had follow-up visits in years 2, 3 and 4.
Column 1/Var0001 = ID
Column 2/Var0002 = Exam Year defined as 1, 2, 3, or 4.
if (Exam.Year=1 & Exam.Year=2) Follow.Up=1.
if (Exam.Year=2 & Exam.Year=3) Follow.Up=1.
if (Exam.Year=3 & Exam.Year=4) Follow.Up=1.
if (Exam.Year=1 & Exam.Year=2 & Exam.Year=3) Follow.Up=2.
if (Exam.Year=2 & Exam.Year=3 & Exam.Year=4) Follow.Up=2.
if (Exam.Year=1 & Exam.Year=2 & Exam.Year=3 & Exam.Year=4) Follow.Up=3.
recode Follow.up (SYSMIS=0).
Where:
1 = 1 Year Follow-up
2 = 2 Year Follow-up
3 = 3 Year Follow-up
If I run this syntax all I get are zero’s so am now at a loss. My syntax ability is “ok” but far from fluent.
Many thanks in advance for any suggestions.