# Performing contrasts among treatment levels in survival analysis

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?

-
Sounds more like a stats question than a programming one. I think this should be moved to crossvalidated.com. –  Roman Luštrik Sep 15 '11 at 14:50

## migrated from stackoverflow.comSep 15 '11 at 14:51

This question came from our site for professional and enthusiast programmers.

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.

-
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 –  Chris Sep 15 '11 at 18:38
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. –  DWin Sep 15 '11 at 19:26
Thanks for the advice! –  Chris Sep 16 '11 at 2:43
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.