Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Just what are -tvc- and -texp- doing in -stcox-?


From   Jocelyn Andrel <[email protected]>
To   [email protected]
Subject   st: Just what are -tvc- and -texp- doing in -stcox-?
Date   Fri, 31 Jul 2009 10:41:52 -0400

Hi,

I'm having trouble with -stcox-. I need to produce predicted survival curves, but my model has a time-dependent covariate, so I can't use -tvc- and -texp-, I have to use -stspilt-, then -stcox-. Which would be fine, except my unsplit and split model simply don't match. Here's the background: the data is time to death from a cancer, the time-dependent covariate is radiation after surgery. Some people had it, some didn't, so the radiation variable is dichotomous (0/1) for radiation, then the time of radiation is there for those who had it, and missing for those who didn't.

I really have two questions:
1. How do -tvc- and -texp- work?
2. What's wrong with this code?

My code looks like:

stset timetoevent, failures(censor) id(id)
stcox age, tvc(rad) texp(timeofrad)

or

stsplit at(failures)
gen radtvc = rad*(_t > timeofrad)
stcox age radtvc

I think the issue centers around the timeofrad variable. It's the time to radiation, and it's different for each patient that had it or missing for those who didn't. If I replace it with a constant, the two different versions of code match perfectly. (I've also tried replacing the missing values in timeofrad with zero, to no avail.)

Any insight would be appreciated.
Thanks in advance,
Jocelyn




*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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