Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: STS Time varying covariates - Problem with _t


From   [email protected]
To   [email protected]
Subject   st: STS Time varying covariates - Problem with _t
Date   Thu, 16 Jan 2003 15:38:35 -0600

I have a dataset where subjects (id) are followed in one of two time periods
(or both time periods) and at some point die or are censored. The data is
arranged as multiple records per subject. For example

id	group	StartTime	EndTime	outcome
1	0	0		350		0
1	1	350		500		1
2	0	0		200		0
2	1	200		600		1
3	1	0		300		0

When I use stset such as

stset EndTime, id(id) time0(StartTime) failure(outcome)

I get data like:
id	group	StartTime	EndTime	outcome	_t	_t0
1	0	0		350		0		350	0
1	1	350		500		1		500	350
2	0	0		200		0		200	0
2	1	200		600		1		600	200
3	1	0		300		0		300	0

which looks appropriate, but when I try to graph a KM curve of the second
time period (group==1) with

sts graph if group==1

I get 600 days worth of time, even though the maximum time anyone spends in
the group 1 time period is 400 days.

A colleague's suggestion was to treat each record like an individual
subject, dropping the 'id(id)' parameter from the STSET command, but my
understanding of the Stata's survival analysis was that it should be able to
handle multiple records per subject. I've reviewed the manuals and the books
"Introduction to Survival Analysis using Stata" and have been unable to
figure this out.

If this is a problem with the KM curves, did it also occur with my 'stcox if
group==1' commands?

Sorry for the long explanation, but any help would be greatly appreciated.

Thanks,
Shawn


*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index