![]() |
From | Mark Lunt <Mark.Lunt@manchester.ac.uk> |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: st: Changing range in sts graph |
Date | Fri, 07 Dec 2007 12:18:53 +0000 |
Svend Juul wrote:
Diego Bellavia <messadua@yahoo.it> wrote:There is the option tmax, which truncates the display of the curve at a given time, without needing to play with the data: should keep everyone happy.
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 showedMaarten suggested:
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.
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
© Copyright 1996–2025 StataCorp LLC | Terms of use | Privacy | Contact us | What's new | Site index |