A goodness-of-fit test for Cox's proportional hazards model is proposed on
the basis of martingale residuals. The test is derived as the score test fo
r the presence of an extra random effect in the exponential part of the haz
ard function. Assumptions about the distribution of the random effects are
not made; only the correlation matrix must be specified. This can be done o
n the basis of an existing division of individuals into groups, such as fam
ilies, or on the basis of the distance between observed covariates. The var
iance of the test statistic is derived using a counting process approach. C
orrections for the estimation of parameters are available. The test is demo
nstrated in a simulated data set as well as in a real data set on ovarian c
ancer.