Hi - I am trying to create a time-varying variable that identifies how long a person has been receiving intervention (i.e., time between assessment 1 and assessment 2; time between assessment 1 and assessment 3, time between assessment 1 and assessment 4, etc.)
Thank you so much in advance for your ideas!
ID | Score | Assessment | Age (months) | Time receiving intervention | |
1 | 20 | 1 | 18 | 0 | |
2 | 30 | 1 | 20 | 0 | |
2 | 35 | 2 | 26 | *Should be 6 (26-20 mos.) | |
3 | 15 | 1 | 24 | 0 | |
4 | 7 | 1 | 30 | 0 | |
5 | 10 | 1 | 26 | 0 | |
5 | 16 | 2 | 30 | *Should be 4 (30-26 mos.) | |
5 | 18 | 3 | 37 | *Should be 11 (37-26 mos.) | |
6 | 40 | 4 | 42 | *Should be 16 (42-26 mos.) |
Thank you so much in advance for your ideas!
Comment