Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: RE: Cox model with a segmented time-dependent covariate


From   Marta Garcia-Granero <[email protected]>
To   [email protected]
Subject   Re: st: RE: Cox model with a segmented time-dependent covariate
Date   Thu, 16 Jan 2014 08:45:03 +0100

Wow!

Thanks a lot Kieran. Now I have to peruse the commands carefully until I understand completely how stsplit works.

So much to learn still after one year using Stata...

Regards,
Marta

El 15/01/2014 23:32, Kieran McCaul escribió:
input  patient time status treatment age lbr0 t1 lbr1 t2 lbr2
   1    281   1   1   46    3.2    47 3.8   184    4.9
   2    604   0   1   57    3.1    94 2.9   187    3.1
   3    457   1   1   56    2.2    61 2.8    97    2.9
   4    384   1   1   65    3.9    92 4.7   194    4.9
   5    341   0   1   73    2.8    87 2.6   192    2.9
   6    842   1   1   64    2.4    94 2.3   197    2.8
   7   1514   1   0   69    2.4    74 2.9   202      3
   8    182   0   0   62    2.4    90 2.5   182    2.9
   9   1121   1   0   71    2.5   101 2.5   410    2.7
  10   1411   0   0   69    2.3   182 2.2   847    2.8
  11    814   1   0   77    3.8   167 3.9   498    4.3
  12   1071   1   0   58    3.1   108 2.8   187    3.4
end

gen lbr = lbr0

stset time, f(status) id(patient)

stsplit one, at(1) after(time=t1)
stsplit two, at(1) after(time=t2)

replace lbr = lbr1 if one==1
replace lbr = lbr2 if two==1

list patient time status lbr0 lbr1 lbr2 lbr _st- _t0 , sepby(patient)

stcox lbr treatment age


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index