Hi all,
I have a dataset I am analysing using survival analyses, with multiple records per patient. I am looking to split up my survival analyses by survival time (e.g. 0-3 years and 3 years+), but I am having trouble working out how to do this.
I wrote the following code before my dataset was split into multiple records per patient, but this isn't working anymore with multiple records per patient, as each patient with multiple records has the same exit point now;
gen timezerothree=dodreg-dateofdiag
*replace timezerothree=lastfu_newformat-dateofdiag if dodreg==.
replace timezerothree=(min(lastfu_newformat,td(31dec2017))-dateofdiag) if dodreg==.
replace timezerothree=timezerothree/365.25
replace timezerothree=3 if timezerothree>3
replace timezerothree=0 if timezerothree==.
gen bcdeathstatus03=1 if timezerothree<3 & timezerothree>0 & bcdeathnew==1
replace bcdeathstatus03=0 if bcdeathstatus03==. & bcdeathnew!=.
replace timezerothree=. if bcdeathnew==.
stset timezerothree, fail(bcdeathstatus03==1) id(patientid)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Can someone please help me?
Related Posts with Splitting up survival analyses by follow-up time
Restrict AxisI would like to restrict the x and y axis of a graph that was made using the following command; sca…
Suest command with more than 300 modelsHi all, I'm estimating arond 1000 models where the only thing that changes is the dependent variabl…
Wildcards with noccurHi there, Can I use wildcards with the egen function noccur? If not, is there another way to use wi…
Using svyset for melogitHello, I am analyzing a binary outcome (depvar) using melogit so that I may 1) account for the comp…
qreg converges in Stata/IC 15.0 (& gives reasonable standard errors), but fails to converge in Stata/MP 17.0Dear All, I have a household-level dataset of 511,877 observations, and run a quantile regression o…
Subscribe to:
Post Comments (Atom)
0 Response to Splitting up survival analyses by follow-up time
Post a Comment