Statalist The Stata Listserver

[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: Overlay survival curves

From   "David Harrison" <>
To   <>
Subject   st: RE: Overlay survival curves
Date   Tue, 7 Mar 2006 15:51:38 -0000

Use -sts generate- to generate one of the survival curves and you can
then overlay it on the other with -addplot()-, e.g.

/* Set up random st data */
set obs 100
gen int time1=ceil(100*uniform())
gen int time2=ceil(100*uniform())
gen byte fail1=uniform()<.8
gen byte fail2=uniform()<.8

/* Plot survival curves */
stset time2, f(fail2)
sts gen s2=s
stset time1, f(fail1)
sts graph, addplot(line s2 time2, sort c(J) legend(order(1 "Outcome 1" 2
"Outcome 2")))

Hope this helps


-----Original Message-----
[] On Behalf Of Esoult
Sent: 07 March 2006 15:31
Subject: st: Overlay survival curves


Is there any way within stata to overlay two survival curves. I have two
separate endpoints and I want to compare the survival curve to each


This email has been scanned by the MessageLabs Email Security System.
For more information please visit 

*   For searches and help try:

© Copyright 1996–2021 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index