I agree, messing with _t is a bad idea and I mess with it in my own
program (context) where _d & _t are preserved in the dataset.
I will (re)visit tmax.
-thanks.
Allen Buxton
CureSearch, Children's Oncology Group
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Mark Lunt
Sent: Friday, December 07, 2007 4:19 AM
To: [email protected]
Subject: Re: st: Changing range in sts graph
Svend Juul wrote:
> 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
>
>
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.
Mark
*
* 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/
*
* 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/