Hi all,
I am working to draw some illustrative example survivorship curves as in the diagram attached. Note, these are slightly different form 'normal' survival curves in that everything goes to zero.
However, I am struggling to get smooth nice-looking curves. Any ideas on better ways to attack this problem?
thanks!
I am working to draw some illustrative example survivorship curves as in the diagram attached. Note, these are slightly different form 'normal' survival curves in that everything goes to zero.
Code:
* simplest option? // clear all set obs 1000 gen t = _n gen fail = rbinomial(1, 0.1) tab fail stset t, fail(fail) sts graph, title("") sts gen surv1 = s twoway (lowess surv1 t, sort lpattern(solid) lwidth(thick) lcolor(orange)) * more complex options // ssc install survsim clear all set obs 1000 set seed 123 gen treat = rbinomial(1,0.5) * lambda = scale; gamma = shape survsim time1 fail, lambdas (20) gammas(10) cov(treat 10) maxt(2) stset time1, fail(fail = 1) sts graph, by(treat) title("") clear all set obs 1000 set seed 123 gen treat = rbinomial(1,0.5) survsim time1 fail, lambdas (20) gammas(0.5) cov(treat 10) maxt(2) stset time1, fail(fail = 1) sts graph, by(treat) title("") exit
thanks!
Comment