
Last chance! 50% off unlimited learning
Sale ends in
This Goodness-of-fit test proposed a modified weighted Schoenfeld residuals to test the proportionality of subdistribution hazards for the Fine and Gray model
psh.test(time, fstatus, z, D=c(1,1), tf=function(x) cbind(x,x^2), init)
vector of failure times
failure status =0 if censored
covariates
components of z that are tested for time-varying effect
functions of t for z being tested on the same location
initial values of regression parameters (default=all 0)
Returns a data.frame with percentage of cens, cause 1, Test Statistic, d.f. ,p-value
The proposed score test employs Schoenfeld residuals adapted to competing risks data. The form of the test is established assuming that the non-proportionality arises via time-dependent coefficients in the Fine-Gray model, similar to the test of Grambsch and Therneau.
Zhou B, Fine JP, Laird, G. (2013). Goodness-of-fit test for proportional subdistribution hazards mode. Statistics in Medicine. In Press.
# NOT RUN {
data(bce)
attach(bce)
lognodes <- log(nnodes)
Z1 <- cbind(lognodes, tsize/10, age, trt)
# trt = 0 if placebo, = 0 treatment
# testing for linear time varying effect of trt
psh.test(time=time, fstatus=type, z=Z1, D=c(0,0,0,1), tf=function(x) x)
# testing for quadratic time varying effect of trt
psh.test(time=time, fstatus=type, z=Z1, D=c(0,0,0,1), tf=function(x) x^2)
# testing for log time varying effect of trt
psh.test(time=time, fstatus=type, z=Z1, D=c(0,0,0,1),
tf=function(x) log(x))
# testing for both linear and quadratic time varying effect of trt
psh.test(time=time, fstatus=type, z=Z1,
D=matrix(c(0,0,0,1,0,0,0,1), 4,2), tf=function(x) cbind(x,x^2))
# }
Run the code above in your browser using DataLab