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
difference in results between including an interaction with categorical variable v. subgroup analysis Hi all! I’m running multinomial logit models with gender as an outcome. Goal: look at gender over t…
Obtaining the 95% confidence interval overlapHi, My actual dataset includes my quantities of interest (A, B, C, and D) obtained from 1000 bootstr…
[STATA 17] Problem with using newly installed commandHello Stata people, I hope everything is fine with you!! I recently purchased a STATA version 17 …
Picking initial log of value added per worker per country in their initial yearHi, I am trying to figure it out how to set up Stata to pick the first log of real value added per …
Is there any way we could permanently set the graphregion(fcolor(white))?I like white plotting background. So, to make it white, I have to set the graph region color option …
Subscribe to:
Post Comments (Atom)
0 Response to Splitting up survival analyses by follow-up time
Post a Comment