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
2023 Canadian Stata ConferenceDear colleagues, The 2023 Canadian Stata Conference will be held on 4 August 2023 at Toronto Metrop…
Categorical Overlay on Bar GraphsI'm having some trouble finding the right way to make this graph. I want to combine two bar charts a…
Use if else loop to implement multiple conditional statementsHi Statalist community, Gig workers are individuals who have multiple employers and they can work f…
Label valuesHello, I have been trying to generate a variable called animal1 following this code: Code: gen byte…
Marginsplot with levels(99 95 90)I would like to plot margins with multiple confidence intervals that appear as bars of narrowing thi…
Subscribe to:
Post Comments (Atom)
0 Response to dealing with a time varying variable in stcox
Post a Comment