I am familiar with the log-rank test for comparing multiple Kaplan-Meier curves, but I am looking for a test that will compare across ordered groups (an ordinal variable). A significant result from the log rank test indicates that at least one of the groups has a survival curve different than the others. I want a test where a significant test indicates that there is a monotonic trend in the survival curves over the levels of the ordinal grouping variable.
As a more concrete example, consider survival curves for cancer of different stages, and I want to show not just that the curves differ, but that the survival worsens as stage increases.
As a bonus, pointers to implementations of the algorithm in R would be appreciated.
Edit to address @dardisco
comment:
When I tried to find a suitable test, I did find a reference so something that seemed appropriate in the documentation for MedCalc software at http://www.medcalc.org/manual/kaplan-meier.php. Two quotes that sounded like what I wanted from that are
Options: Linear trend for factor levels: Allows testing for a linear trend across levels of the factor. It is appropriate if factor levels have a natural ordering (for example, factor codes represent doses applied to different groups). Kaplan-Meier assumes that the factor levels are equally spaced.
and
Logrank test for trend: If more than two survival curves are compared, and there is a natural ordering of the groups, then MedCalc can also perform the logrank test for trend. This tests the probability that there is a trend in survival scores across the groups.
But no specific algorithm for this test is stated.
Best Answer
Function
comp
in survMisc may be close to what you're after. From the docs:For example:
This will give tests for trend with various weights (as are used with the standard log-rank test):
The package has been changed slightly, and instead of
tests
ortrendtests
, usetft
, which stands for... tests for trend. Furthermore, when using thecomp()
function, type it like this:comp(ten(<whatever your survival-fit object is>))
.