Skip to content

Schoenfeld Residuals

3 messages · David Winsemius, Laura Bonnett

#
Dear All,

Sorry to bother you again.

I have a model:
coxfita=coxph(Surv(rem.Remtime/365,rem.Rcens)~all.sex,data=nearma)
and I'm trying to do a plot of Schoenfeld residuals using the code:
plot(cox.zph(coxfita))
abline(h=0,lty=3)

The error message I get is:
Error in plot.window(...) : need finite 'ylim' values
In addition: Warning messages:
1: In sqrt(x$var[i, i] * seval) : NaNs produced
2: In min(x) : no non-missing arguments to min; returning Inf
3: In max(x) : no non-missing arguments to max; returning -Inf

My data (nearma) has a lot of rem.Remtime entries which are equal i.e
large amounts of tied data.  If I remove the entries where this is the
case from the dataset I get the results I want!

Please can someone explain why removing paients with tied remission
time has such an effect on the code and also how to remedy the problem
without removing patients?

Thank you very much,

Laura.
#
I am not sure that ties are the only reason. If I create a few ties in  
the ovarian dataset that Therneau and Lumley provide, all I get are  
some warnings:
 > ovarian[4:5, 1] <- mean(ovarian[4:5, 1])
 > ovarian[6:8, 1] <- mean(ovarian[6:8, 1])
 > fit <- coxph( Surv(futime, fustat) ~ age + rx, ovarian)
 > temp<- cox.zph(fit)

 > plot(temp)
Warning messages:
1: In approx(xx, xtime, seq(min(xx), max(xx), length.out = 17)[2 *  :
   collapsing to unique 'x' values
2: In approx(xtime, xx, temp) : collapsing to unique 'x' values

The error message you get is requesting a finite ylim. Have you  
considered acceding with that request?

Alternative: Assuming the number of tied survival times is modest,  
have you tried jitter-ing the rem.Remtime variable a few times to see  
it the results are stable?

If the number of ties is large, then you need to review Thernaeu &  
Gramsch section 3.3
#
Thank you for your comments.  I have about 200 out of 2000 tied data
points which makes the situation more complicated!  I'll have at look
at the book section you referred to.  With regards to making the ylim
finite, I'm not sure how I can go about that given that I don't
understand why it isn't already!

Thank you for your help,

Laura

2009/4/3 David Winsemius <dwinsemius at comcast.net>: