Hello, I wonder if I'm coding this correctly
I am plotting a risktable + KM curve for those who were revised==1
However as you can see in this KM that at 15 years everyone is dying when it's not actually true. I suspect it because either the srurvialt2 is left as missing if patient did not have a revision revised=0 and therefore has no revisiondate=.
Am i correct in saying this and if not what is your advice

I am plotting a risktable + KM curve for those who were revised==1
Code:
//value in days gen survivalt= revisiondates-OpDate gen survivalt2=survivalt/365 stset survivalt2, failure(revised==1) //Kaplan meir curve in terms of survival sts graph, risktable
Am i correct in saying this and if not what is your advice
Code:
* Example generated by -dataex-. For more info, type help dataex
clear
input float(OpDate revisiondates revised survivalt survivalt2) byte(_st _d) double _t byte _t0
17783 17839 1 56 .15342465 1 1 .15342465043067932 0
17947 21967 1 4020 11.0137 1 1 11.01369857788086 0
17904 . 0 . . 0 . . .
. . 0 . . 0 . . .
. . 0 . . 0 . . .
. . 0 . . 0 . . .
17482 22466 1 4984 13.654795 1 1 13.654794692993164 0
. . 0 . . 0 . . .
. . 0 . . 0 . . .
. . 0 . . 0 . . .
. . 0 . . 0 . . .
. . 0 . . 0 . . .
. . 0 . . 0 . . .
. . 0 . . 0 . . .
. . 0 . . 0 . . .
17932 21566 1 3634 9.956164 1 1 9.956164360046387 0
17497 22945 1 5448 14.926027 1 1 14.926027297973633 0
17518 19121 1 1603 4.391781 1 1 4.391780853271484 0
. . 0 . . 0 . . .
. . 0 . . 0 . . .
. . 0 . . 0 . . .
. . 0 . . 0 . . .
. . 0 . . 0 . . .
17504 . 0 . . 0 . . .
17474 17508 1 34 .09315068 1 1 .09315068274736404 0
. . 0 . . 0 . . .
17381 19359 1 1978 5.419178 1 1 5.419178009033203 0
. . 0 . . 0 . . .
19015 . 0 . . 0 . . .
19016 22210 1 3194 8.750685 1 1 8.75068473815918 0
end
format %td OpDate
format %td revisiondates

Comment