M. Khedr wrote:
> I have a data set similar to Stanford heart transplant
> data
> 
> 1. some patients on waiting list who did not receive a
> transplanted organ
> 
> 2. others received a transplanted organ
> 
> if we want to consider transplantation as a time
> dependent covariate " the risk of death before
> transplantation is deferent form the risk after
> transplantation". knowing that we have 
> 
> Listing date
> Transplantation date
> Last seen date
> 
> and one record per patient
> 
> how to generate a time dependent covariate in this
> case.
Use -stsplit- to split the records at transplantation date 
(after you have properly -stset- your data):
 . stsplit transplant, after(transplantdate) at(0)
(assuming that 'transplantdate' is in the same units as the timevar in
-stset- and transplantdate==. for cases without transplantation) 
 
The new variable 'transplant' will equal -1 before transplantation and 0
thereafter. So you might want to recode:
 . replace transplant=transplant+1
I hope this works.
ben
PS: Also see -stsplit- in the ST-manual (Example 3 on p. 337). The
approach presented there is, however, much more complicated.
*
*   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/