Hi
I'm working with a longitudinal dataset that follows a set of children from date of diagnosis onward. I just realized that several subjects are lacking data during the first few months post-diagnosis. I want to create a variable 'D12' that groups children into two groups, D12==1 if they have data that starts anytime before the thirteenth month before diagnosis and D12==2 for subjects who have data that only starts after the twelfth month (and hence not included in the analysis).
This variable will have to based on duration (months):
- How do I specify category 2 above? This group has subjects with data on variables only from the thirteenth month onward. Category 1 subjects can have data pre- and post the twelfth month.
Thanks
/Amal
I'm working with a longitudinal dataset that follows a set of children from date of diagnosis onward. I just realized that several subjects are lacking data during the first few months post-diagnosis. I want to create a variable 'D12' that groups children into two groups, D12==1 if they have data that starts anytime before the thirteenth month before diagnosis and D12==2 for subjects who have data that only starts after the twelfth month (and hence not included in the analysis).
This variable will have to based on duration (months):
Code:
gen D12 = duration replace D12 = 1 if duration<12.1 replace D12 = 2 if
Thanks
/Amal
Comment