I'm reviewing a paper where the authors compare the survival of an insect fed on three different diets.

Following the survival analysis (using Surv) they perform multiple comparisons of the mean survival among the treatments using the contrasts procedure from Crawley's The R book. They present their results a la a Tukey test (i.e., means with significantly different values have different letters).

Comparisons between 2 treatment levels in R can be done with survdiff, but that generates a chi-square statistic which doesn't jive with what I'm seeing in the paper

The more general question of post-hoc tests in survival analysis when there are >2 treatment levels (akin to Tukey's test) has been asked on R-help before but never answered.

My problem is twofold: I'm not familiar with survival analysis to know if the contrast procedure is appropriate to the question, and I don't have access to Crawley's book.

Can someone provide an example of Crawey's method or point to a web resource where his method is explained?


2 Answers 2


The methods description does not match up with anything I see in Crawley's chapter on survival analysis. His discussion of the example he used with three levels seem pretty rudimentary (one might even say naive, but I am not a big fan of his book.) There is no surv function, and the closest function, Surv, is not a regression function at all, but rather a method to construct an object suitable to use in the LHS of formulae in a regression model.

Likewise for the "contrasts procedure". There is no such thing. Factors in R generate treatment contrasts unless otherwise specified to the regression function, but there is not "contrasts procedure". If there were three levels under consideration then there would be a reference level whose "effect" would be included in the Intercept, and there would be two coefficients, one for each of the other levels. Those coefficients would be the difference from the reference level measured on the log-hazard scale. Exponentiated they would become relative hazards.

I do not see that the multiple comparisons problem is specific to survival analysis. You are estimating parameters, and if they are normally distributed under asymptotic assumptions, then you should be able to apply reasonable methods. There are a variety of such adjustments supported in the p.adjust function in the stats package.

  • $\begingroup$ I should have stated that I assumed they used Surv, as they don't actually say anything beyond that they used R. I also corrected the typo for surv vs. Surv $\endgroup$
    – Chris
    Commented Sep 15, 2011 at 18:38
  • $\begingroup$ If that is all they say, then as a reviewer you can honestly offer an opinion that their methods are inadequately described. And citing Crawley should not pass muster as authoritative, either. It's really just a collection of brief worked examples that assume the user has other theoretical resources. $\endgroup$
    – DWin
    Commented Sep 15, 2011 at 19:26

In the R rms package there is are wrapper function for the survival package's coxph and survreg functions. When you use one of these two functions you can use contrast.rms to easily obtain single d.f. or multiple d.f. contrasts. Type ?contrast.rms for guidance. You need to substitute cph for coxph when using rms.

  • $\begingroup$ I was not able to use this function to obtain post-hoc contrasts of a coxph analysis, could you give an example? $\endgroup$
    – Nakx
    Commented Jan 16, 2018 at 5:41
  • 1
    $\begingroup$ At the command line type require(rms) then ?cph then ?contrast.rms where you'll see arguments defined plus several examples. $\endgroup$ Commented Jan 16, 2018 at 12:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.