I am using the survminer
survival package in R. To compute p values to compare survival curves, I am using the surf_pvalue
function.
With this function, you can determine the log-rank p value in two different ways. One is called "survdiff", the other "1" or "LR". See this link for more info. The second says that it is a "regular log-rank test, sensitive to detect late differences", but what are the differences between the two. Does anyone know?
Thank you.
The methods "survdiff"
, "log-rank"
, "LR"
, "1"
all give the same results.
Here is a minimal & reproducible example
library(survival)
library(survminer)
fit <- surv_fit(Surv(time, status) ~ sex, data = colon)
methods <- c("survdiff", "log-rank", "LR", "1")
purrr::imap(setNames(methods, methods), ~surv_pvalue(fit, method = .x))
#$survdiff
# variable pval method pval.txt
#1 sex 0.6107936 Log-rank p = 0.61
#
#$`log-rank`
# variable pval method pval.txt
#1 sex 0.6107936 Log-rank p = 0.61
#
#$LR
# variable pval method pval.txt
#1 sex 0.6107936 Log-rank p = 0.61
#
#$`1`
# variable pval method pval.txt
#1 sex 0.6107936 Log-rank p = 0.61
If we take a look at the source code of survminer
we see that
[...]
allowed.methods <- c("survdiff", "log-rank", "LR", "1",
"n", "Gehan-Breslow", "GB",
"sqrtN", "Tarone-Ware", "TW",
"S1", "Peto-Peto", "PP",
"S2", "modified Peto-Peto", "mPP",
"FH_p=1_q=1", "Fleming-Harrington(p=1, q=1)", "FH")
method.names <- c(rep("survdiff", 4),
rep(c("n", "sqrtN", "S1", "S2", "FH_p=1_q=1"), each = 3))
[...]
All four methods are unified as method.names = "survdiff"
.