I have about 120 subject ids, each has 7 different lab tests, some of the tests are done at a different dates, l have a column with the dates of each test. I need to calculate the interval between each consecutive test in each column.
for example alt i need the duration between each alt test for the specific subject
Is there a way to calculate this with all variables or it should be done separately one variable at a time?
Thanks
for example alt i need the duration between each alt test for the specific subject
Is there a way to calculate this with all variables or it should be done separately one variable at a time?
Thanks
Code:
* Example generated by -dataex-. For more info, type help dataex clear input int id byte ast int(plt alk) double direct_bili byte(alt bilirubinindirectexternallab ggt) int results_date 352 42 214 99 . 53 . . 20825 352 40 . . . 65 . . 21070 352 36 190 90 .2 58 . 40 21385 352 47 286 138 .1 38 . . 21623 5759 40 . 128 . 35 . . 21728 5759 76 . 102 . 49 . . 21740 5759 . 200 . . . . . 21747 26570 . 295 . . . . . 21756 26570 38 . 106 . 40 . . 21903 26570 19 192 75 .3 21 . 53 22134 26570 29 241 84 . 34 . 34 22735 32659 21 . 88 . 25 . . 22946 32659 24 282 75 . 25 . . 20825 32659 . 286 . . . . . 21108 32659 22 . . . 22 . 9 21126 end format %tddd-Mon-YY results_date
Comment