Statalist


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

RE: st: Changing range in sts graph


From   David Pitt <[email protected]>
To   [email protected]
Subject   RE: st: Changing range in sts graph
Date   Fri, 07 Dec 2007 23:47:09 +1100



-----Original Message-----
From: [email protected] on behalf of Mark Lunt
Sent: Fri 7/12/2007 11:18 PM
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/

<<winmail.dat>>




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