Statalist


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

Re: st: Changing range in sts graph


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:


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/




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