Dear Statalist,
Is there a way to plot multiple survival curves after using a Cox model with bootstrap? I mean, to plot 100 (or any other) replicates from bootstrap in a single Kaplan-Meier graph.
I was thinking of the next pseudocode:
* stset date2, failure(event==1) origin(date1) id(id)
* stcox my_variable, vce(bootstrap, reps(100) seed(1234))
* sts gen s_myvar = f, by(my_variable)
* sort _t
* twoway connected s_myvar _t
I do not know how to integrate the last three lines to get the estimates from each of the 100 bootstrap replicate so I can plot them into a single Kaplan-Meier.
Thank you!
Is there a way to plot multiple survival curves after using a Cox model with bootstrap? I mean, to plot 100 (or any other) replicates from bootstrap in a single Kaplan-Meier graph.
I was thinking of the next pseudocode:
* stset date2, failure(event==1) origin(date1) id(id)
* stcox my_variable, vce(bootstrap, reps(100) seed(1234))
* sts gen s_myvar = f, by(my_variable)
* sort _t
* twoway connected s_myvar _t
I do not know how to integrate the last three lines to get the estimates from each of the 100 bootstrap replicate so I can plot them into a single Kaplan-Meier.
Thank you!
Comment