I'm doing some cross cohort research on SEP and mortality across 3 different cohorts and would like to overlay them onto one graph. Would anyone have any solutions to this. I have viewed previous threads (https://www.stata.com/statalist/arch.../msg00875.html) although my needs are slightly different and I have had trouble adapting this, and would appreciate any help.
My cohorts have 3 different ages at follow up (Cohort 1: 70, Cohort 2: 58, and Cohort 3: 43 ) therefore each survival curve would require a different length, and setset. I've stripped the code down to the bare minimum needed to translate what I need:
Code:
stset exitdate70, failure(dead70) origin(entrydate) enter(age_26) id(pid) scale(4) if cohort==1 & cc1==1 sts graph if cohort==1 & cc1==1, by(housing) stset exitdate58, failure(dead58) origin(entrydate) enter(age_26) id(pid) scale(4) if cohort==2 & cc2==1 sts graph if cohort==2 & cc2==1, by(housing) stset exitdate43, failure(dead43) origin(entrydate) enter(age_26) id(pid) scale(4) if cohort==3 & cc3==1 sts graph if cohort==3 & cc3==1, by(housing)
0 Response to Overlay 3 kaplan-meier survival graphs from 3 different populations
Post a Comment