Dear Statalist,
I have a date variable created the following way:
It is the participation date for individuals with COPD who participated in either of/both the first (NT2) or the second (NT3) cycle of a population study (their final PartDat_gli depends on when they were diagnosed with COPD, that's why some have the date from NT3 despite participating in both cycles). I use the date variable to -stset- before -stcox-.
I now want to run a sensitivity analysis excluding the first 3 years of the follow-up time. How could I add 3 years for each participant to this date variable, taking into account the different participation dates? I tried to have a look at earlier threads in the forum, but I couldn't find a solution to my exact problem.
Best regards,
Sigrid Vikjord
I have a date variable created the following way:
Code:
gen PartDat_gli = . replace PartDat_gli = PartDat_NT2BLQ1 if copd_HUNT==1 replace PartDat_gli = PartDat_NT3BLQ1 if copd_HUNT==2
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input long(PartDat_NT2BLQ1 PartDat_NT3BLQ1) float PartDat_gli 13444 17079 . 13114 17293 . 13619 17675 . 13040 . . 13537 . . 13065 . . 13300 17289 . 13661 17640 . 13522 17538 . 13116 17342 . 13468 . . 13394 . . 13212 17448 . 13117 17385 . 13425 . . 13670 17674 . 13377 . . 13403 . . 13654 17689 . 13459 17274 . 13535 17580 17580 13647 . . 13207 17140 13207 . 17651 . . 17644 . 13236 17498 . 13124 17282 . 13082 17475 . . 17324 17324 13388 17237 . . 17336 . . 17553 . 13201 . 13201 13216 17489 . 13675 17644 . . 17189 . 13480 17672 . 13677 17660 . 13472 17667 . 13614 . . 13065 17343 . . 17632 . . 17623 . 13403 . . 13675 17688 . 13543 17230 . 13569 . . 13683 . . 13457 . . 13440 . 13440 13293 . . 13678 17660 . 13055 17321 . 13430 17092 . 13165 17395 . 13115 . . 13135 . . 13293 . . . 17391 . 13079 17447 . . 17707 . 13193 . . 13461 17317 . 13317 17238 . 13123 . . 13206 . . 13591 17630 17630 13475 17566 . . 17491 . . 17328 . 13032 . . 13152 . . 13289 17589 . 13499 17505 . . 17406 . 13212 . . 13130 17205 . 13191 . 13191 13310 17283 . 13221 17447 . 13234 17492 . 13038 17407 . 13565 . . . 17660 . 13255 . . 13416 . . . 17315 . . 17632 . 13212 . . 13534 . . 13375 . . . 17290 . 13235 17174 . . 17475 . 13424 17120 . 13052 . . . 17269 . 13628 . 13628 13212 17496 . 13289 . . end format %tdD_m_Y PartDat_NT2BLQ1 format %tdD_m_Y PartDat_NT3BLQ1
It is the participation date for individuals with COPD who participated in either of/both the first (NT2) or the second (NT3) cycle of a population study (their final PartDat_gli depends on when they were diagnosed with COPD, that's why some have the date from NT3 despite participating in both cycles). I use the date variable to -stset- before -stcox-.
I now want to run a sensitivity analysis excluding the first 3 years of the follow-up time. How could I add 3 years for each participant to this date variable, taking into account the different participation dates? I tried to have a look at earlier threads in the forum, but I couldn't find a solution to my exact problem.
Best regards,
Sigrid Vikjord
Comment