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
Foreach loop using macro in numlistProbably a simple syntax issue, but I can't figure this out after reading the documentation on forea…
Transforming panel data with different time pointsHello, I am using data collected from 36 different hospitals over the course of 7 quarters (2015q2 -…
Quintilehi I am new to the stata forum. I am currently working on my thesis topic " poverty and consumption …
Xtabond2 Newbie questionHi, I am a quite newbie to dynamic panels. For my project, I want to run a simple model on governmen…
Problem with Hausman test in xsmleI was estimating spatial panel data models in STATA, when I tried to perform Hausman test, the follo…
Subscribe to:
Post Comments (Atom)
0 Response to Splitting up survival analyses by follow-up time
Post a Comment