Learn R Programming

emil (version 2.0.2)

pvalue.survdiff: Extracts p-value from a logrank test

Description

Extracts p-value from a logrank test

Usage

## S3 method for class 'survdiff':
pvalue(x, log_p = FALSE, ...)

Arguments

x
Logrank test result, as returned by survdiff.
log_p
Whether to return the logarithm of the p-value.
...
Ignored. Kept for S3 consistency.

Value

  • p-value. library(survival) y <- Surv(time=1:100, event=rep(1:0, each=50)) groups <- rep(1:2, each=50) x <- survdiff(y ~ groups)

    # Compare p-values of implementations print(x) pvalue(x)

See Also

pvalue