Diego Bellavia <[email protected]> wrote:
> I have a Kaplan Meyer curve I built with sts command.
> The curve is nice but I would like to reduce the range of time showed
> to highlight the first part of the graph (where I have more events).
> I tried with the xscale (range (0 100)) option but without success.
Maarten suggested:
sysuse cancer, clear
stset studytim,failure(died)
sts graph
sts graph if _t < 20
and Allen Buxton suggested:
local rangelimit=100
replace _d=0 if _t>`rangelimit'
replace _t=`rangelimit' if _t>`rangelimit'
Nick got nervous:
Doesn't any messing with _t mess up anything later with the same
survival dataset? Sounds a bad idea to me. See Maarten's solution.
-----------------------------------------------------
Allen's suggestion is right, Maarten's is wrong. It is easy to
see with -sts list- :
sysuse cancer, clear
stset studytim,failure(died)
sts list
// Maarten's suggestion:
sts list if _t < 20
// Allen's suggestion (simplified):
replace _d=0 if _t>20
replace _t=min(_t,20)
sts list
In Maartens suggestion, persons surviving 20 months or more
were excluded from the analysis, leading to a far too pessimistic
survival estimate at 19 months. In Allen's suggestion they
are correctly censored at 20 months.
Svend
__________________________________________
Svend Juul
Institut for Folkesundhed, Afdeling for Epidemiologi
(Institute of Public Health, Department of Epidemiology)
Vennelyst Boulevard 6
DK-8000 Aarhus C, Denmark
Phone: +45 8942 6090
Home: +45 8693 7796
Email: [email protected]
__________________________________________
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/