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
How toextract the results of various stata commands into matrices or mata universally and selectivelyFor stata commands(such as npresent, fsum, etc.) without a matrix in the return values(the result of…
Separating epiweeks with corresponding yearsGood day all I was wondering if you could please help. I have a data set with years 2020 and 2021. …
changing numbers that surround decimalsI have 18,000 observations in a variable, which I have cleaned down to 60 left to address. They are …
could not estimate full model no observations r(2000)I'm a new of STATA , I have some data for analysis Multiple logistic regression and I got error r(20…
How would I create a 95% CI on a scatter plot?This might be very simple, but how would I show a 95% confidence interval on a scatter plot which pa…
Subscribe to:
Post Comments (Atom)
0 Response to dealing with a time varying variable in stcox
Post a Comment