[R] scaled Schoenfeld residuals

Greg Dropkin gregd at gn.apc.org
Thu Sep 24 00:03:50 CEST 2009


hi

sorry if this has been discussed before, but I'm wondering why the scaled
Schoenfeld residuals do not follow the defining formula for obtaining them
from the ordinary Schoenfeld residuals, but are instead offset by the
estimated parameter values.

e.g.

library(survival)
attach(ovarian)
sv<-Surv(futime,fustat)
f1<-coxph(sv~age+ecog.ps)
f1
schres<-resid(f1,type="schoenfeld")
schresc<-resid(f1,type="scaledsch")
n=sum(fustat)
V<-f1$var
schresc1<-t(n*V%*%t(schres))

#schresc1 is how the scaled Schoenfeld residuals are defined
#in terms of the number of events
#variance of the parameter estimates,
#and ordinary Schoenfeld residuals
#but schresc1 and schresc differ

schresc
schresc1

#schresc is schresc1 offset by the parameter estimates

beta<-as.vector(f1$coef)
nbeta<-outer(rep(1,n),beta)
nbeta
schresc-nbeta
schresc1

#is there a reason for the offset
#or am I missing something?

thanks

Greg

Greg Dropkin
gregd at gn.apc.org




More information about the R-help mailing list