Hello everyone,
Please how do I create the 'study time/time variable', which is the months to death or date of interview for those that were right-censored, to be used in survival analysis using DHS data?
I understand I need to use the id, date of birth (b3_tm), age at death in months (b7), and date of interview (v008_tm) variables to create the time variable needed for the analysis.
Below is the dataex code
Thank you for your help.
Please how do I create the 'study time/time variable', which is the months to death or date of interview for those that were right-censored, to be used in survival analysis using DHS data?
I understand I need to use the id, date of birth (b3_tm), age at death in months (b7), and date of interview (v008_tm) variables to create the time variable needed for the analysis.
Below is the dataex code
Thank you for your help.
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str16 id float b3_tm byte b7 float v008_tm " 1 2 21" 566 . 583 " 1 2 22" 538 . 583 " 1 4 21" 559 . 583 " 1 4 22" 559 . 583 " 1 4 23" 535 . 583 " 1 36 21" 581 . 583 " 1 36 22" 557 . 583 " 1 38 21" 572 . 583 " 1 38 71" 574 . 583 " 1 38 72" 533 . 583 " 1 55 21" 537 . 583 " 1 57 21" 564 . 583 " 1 57 22" 527 . 583 " 1 63 41" 576 . 583 " 1 63 42" 536 . 583 " 1 67 71" 533 . 583 " 1 69 21" 580 . 583 " 1 73 21" 573 . 583 " 1 73 22" 553 . 583 " 1 75 21" 575 . 583 " 1 75 22" 558 2 583 " 1 78 21" 581 . 583 " 1 78 22" 546 . 583 " 1 81 11" 580 . 583 " 1 81 12" 546 . 583 " 1 82 21" 563 . 583 " 1 82 22" 545 4 583 " 1 82 71" 564 . 583 " 1 82 72" 533 . 583 " 1 84 21" 577 . 583 " 1 86 21" 558 . 583 " 1 86 22" 533 . 583 " 2 2 21" 573 0 581 " 2 2 22" 561 . 581 " 2 4 21" 553 . 581 " 2 4 22" 528 36 581 " 2 7 21" 529 . 581 " 2 7 31" 565 . 581 " 2 7 32" 537 . 581 " 2 14 21" 551 . 581 " 2 14 22" 527 13 581 " 2 19 21" 578 . 581 " 2 19 22" 544 . 581 " 2 19 23" 531 36 581 " 2 22 31" 579 . 581 " 2 22 32" 557 . 581 " 2 22 33" 529 . 581 " 2 24 21" 555 . 581 " 2 27 21" 555 . 581 " 2 27 31" 572 . 581 " 2 27 32" 528 . 581 " 2 27 171" 529 8 581 " 2 29 21" 571 . 581 " 2 29 22" 529 . 581 " 2 32 31" 567 . 581 " 2 32 32" 544 . 581 " 2 34 21" 573 . 581 " 2 34 22" 546 . 581 " 2 34 31" 572 . 581 " 2 34 32" 540 . 581 " 2 41 21" 523 . 581 " 2 44 21" 576 . 581 " 2 49 21" 558 . 581 " 2 56 21" 566 . 581 " 2 56 22" 541 19 581 " 2 61 61" 546 . 581 " 2 61 62" 535 . 581 " 2 64 21" 569 . 581 " 2 64 31" 530 . 581 " 2 71 21" 567 12 581 " 2 71 22" 557 10 581 " 2 76 21" 580 . 581 " 2 88 21" 564 . 581 " 2 88 22" 546 20 581 " 2 88 31" 548 . 581 " 2 93 21" 560 . 581 " 2 93 22" 532 . 581 " 2 96 21" 580 . 581 " 2 96 22" 529 . 581 " 2 98 21" 564 . 581 " 2 98 22" 534 . 581 " 2101 21" 574 . 581 " 3 1 21" 528 . 581 " 3 3 21" 580 . 581 " 3 3 22" 560 . 581 " 3 3 23" 527 . 581 " 3 5 21" 544 . 581 " 3 8 21" 557 . 581 " 3 8 22" 533 . 581 " 3 14 21" 549 . 581 " 3 17 21" 557 . 581 " 3 17 22" 537 . 581 " 3 21 21" 558 . 581 " 3 23 21" 552 . 581 " 3 25 21" 557 . 581 " 3 30 61" 526 21 581 " 3 32 21" 562 . 581 " 3 32 22" 540 . 581 " 3 34 21" 545 . 581 " 3 37 21" 563 . 581 end format %tmNN-CCYY b3_tm format %tmNN-CCYY v008_tm

Comment