I am analyzing survival in a group of respiratory patients
it turns out that one of my variables (FVC, a measure of respiratory function expressed in percentage of predicted value, that is, the higher the better), has a time-varying effect on survival. If I do
stcox fvc
I get an highly significant effect:
HR .969788, 95% CI .9642006 .9754077
but estat phtest in unhappy:
Test of proportional-hazards assumption, Global test chi2 18.03 , df 1, p= 0.0000
What apparently is happening (plotting the curve of patients above or below the median fvc), is that survival in patients with a better FVC begins to decrease with a delay of about two years compared with those with poorer respiratory function, which makes sense.
For what I understand from the stata survival analysis reference manual, there are two possible (apparently equivalent) solutions:
a) use the tvc and tvexp options, that is:
stcox fvc, tvc(fvc) tvexp(_t>=2)
b) stsplit the data at time 2 and build an interaction variable with time:
stsplit twoyears, at(2)
gen fvc2=fvc*(twoyears==2)
stcox fvc fvc2
I did try both solutions, and they give very similar but slightly different solutions:
solution a gives:
main HR .9502671 (95% CI .939542 .9611146)
tvc HR 1.008867 (1.004696 1.013055)
while solution b:
-------------+----------------------------------------------------------------
fvc HR .9590344 ( .9508496 .9672896)
fvc2 HR 1.020984 ( 1.009306 1.032797)
Reassuringly, this solution made estat phtest, detail happy:
fvc rho 0.05118, chi2 1.29, df 1, p= 0.2566
fvc2 rho -0.02088, chi2 0.20, df 1, p= 0.6525
Global test chi2 1.64, df 2, p= 0.4409
my questions are:
a) Am I correct?
b) Should I care for the very slight difference?
c) what should I do with the coefficient of the interaction variable?
thanks!
Related Posts with dealing with a time varying variable in stcox
Spilt variable and fill in numeric terms in the stringDear Statalist, I have a variable called Name which looks like below. I would like to spilt Name in…
How can I get gr_edit to refer to specific graphs when multiple graphs are open in the graph window?I'm using a user-created command (-synth2-) that generates multiple graphs as outputs. I want to be …
What components should I pay attention to when buying a new laptop for Stata?Hello Statalisters, I don't know if I'm allowed to post this thread as it is not related to Stata p…
Eliminating leading blanks from a stringHi all, It seems there are leading blanks for a string variable state in 2 out of 5 rounds of data …
De-trending Panel DataHi everyone, I need help with detrending panel data. I have a panel of firm observations across year…
Subscribe to:
Post Comments (Atom)
0 Response to dealing with a time varying variable in stcox
Post a Comment