Learn R Programming

emil (version 1.1-6)

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

Description

Extracts p-value from a logrank test

Usage

## S3 method for class 'survdiff':
p.value(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) p.value(x)

See Also

p.value