# Pairwise Log-rank Tests on Cox Proportional Hazard Models: are they even necessary?

As background, I have data on the survival of insects on six different species of plants. The hypothesis that I'm trying to test is that each plant species produces a survival curve significantly different than all the others. I have it formatted so each row is an organism and the plant species it was grown on represented by a factor in the "Species" column.

eg. |ID|Species| |:-|:------| |1|A. curassavica| |2|S. ducamara| |3|A. sericifera| |4|A. curassavica|

When I run a CPH model in r (survival & survminer packages) using the Species column as predictor, I'm given a model where survival curves of five of the species are compared to that of the sixth species (I presume).

Questions:

1. Is this even telling me what I want to know? Should I re-format the data so that each species is its own column with a binary indicator of if the insect was raised on that plant? (each insect was only grown on one species)
2. Is there an easy way to carry out pairwise comparisons between all of the species to see if they're all significantly different from each other? (I've tried using the pairwise_survdiff() function but have run into errors)
3. Is it even necessary to do pairwise comparisons between all the different species if all the global tests for the model are significant? (eg. Likelihood ratio, Wald, logrank)

2. You can approach this as with pairwise comparisons in analysis of variance. If pairwise comparisons are needed, you should incorporate a correction for multiple comparisons. The R emmeans package provides a coherent approach to such analyses in a wide variety of modeling contexts. As I recall, with a Cox model it will provide estimated differences in log-hazard for all levels of a predictor, versus an average among them. That gets around using one species as the reference.
• The likelihood ratio $\chi^2$ test from the Cox model is the gold standard for the global $H_{0}$. The OP should not refer to logrank tests; stick with the full Cox model and recognize the logrank is a special case of Cox and is not needed. Consider simultaneous confidence intervals for as many hazard ratios as desired (see the R rms contrast.rms and cph functions). Reduce use of statistical significance testing. Commented Feb 14, 2021 at 12:25