0
$\begingroup$

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)
$\endgroup$

1 Answer 1

1
$\begingroup$
  1. A Cox model has a baseline hazard instead of an intercept. In standard treatment coding with a linear regression model, the intercept represents the estimated outcome value for the reference levels of all predictors. That's the reference level of each categorical predictor, 0 for a continuous predictor. Coefficients for other levels of a categorical predictor represent differences from that intercept determined by the reference level. Similarly, the baseline hazard in a Cox model is that for the reference levels of categorical predictors; coefficients for other levels represent associated differences in log-hazard from the baseline. Attempts to code the levels as multiple binary predictors will not help.

  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.

  3. If all you care about is whether there are any differences among species, then there is no need to do pairwise comparisons. Otherwise, see Point 2 for doing all pairwise comparisons. If there were only a few specific comparisons that you had in mind before you saw the results, you could do those and have a less vigorous correction for multiple comparisons.

$\endgroup$
3
  • 1
    $\begingroup$ 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. $\endgroup$ Commented Feb 14, 2021 at 12:25
  • $\begingroup$ @FrankHarrell Thanks for the comment. Would you mind elaborating on what you mean by "logrank is a special case of Cox" and/or point me toward some reading? I'm new to CPH models, so I'm still trying to learn the ins and outs. $\endgroup$
    – lgreenst
    Commented Feb 14, 2021 at 22:06
  • 1
    $\begingroup$ @lgreenst see the Wikipedia logrank test page, and Frank Harrell's course notes, Section 20.4. Logrank is just the score test on a simple Cox model. Harrell's course notes and book provide much insight not only into survival modeling but also into regression modeling in general. Taken together with the vignettes in the R survival package, you have some great resources from which to start learning. $\endgroup$
    – EdM
    Commented Feb 14, 2021 at 22:40

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.