Extracts p-value from a logrank test
# S3 method for survdiff
pvalue(x, log_p = FALSE, ...)
Logrank test result, as returned by survdiff
.
Whether to return the logarithm of the p-value.
Ignored. Kept for S3 consistency.
p-value. if(requireNamespace("survival", quitely = TRUE))
y <- survival::Surv(time=1:100, event=rep(1:0, each=50)) groups <- rep(1:2, each=50) x <- survival::survdiff(y ~ groups)
# Compare p-values of implementations print(x) pvalue(x)