When censoring depends on both treatment group and covariates, tests for a
randomised treatment effect arising from Cox's proportional hazards model a
re not in general centred at zero under the null and can be seriously disto
rted. We propose a corrected test that modifies the at-risk indicator in a
way that corrects for this bias. The resulting test is asymptotically valid
regardless of whether or not the fitted model is correctly specified. Impl
ementation of the corrected test requires that the dependence of censoring
on treatment group and covariates be modelled. Simulations indicate that th
e bias-corrected test performs well, even when the dependence of censoring
on treatment group and covariates is not modelled exactly, and maintains hi
gh efficiency relative to the uncorrected test when the latter is valid.