Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

logrank

The Log-rank test


Description

Performs the log-rank test on survival data, possibly stratified.

Usage

logrank(Y, group, data = parent.frame())

Arguments

Y

a survival object as returned by the Surv function.

group

defines the groups to be compared. Coerced to a factor.

data

a data.frame in which to interpret the variables.

Value

A list of class logrank with components

test.statistic

The logrank (score) test statistic.

df

The degrees of freedom of the test statistic.

p.value

The p value of the test.

hazards

A list of two-column matrices, describing event times and corresponding hazard atoms in each stratum (class 'hazdata').

call

The call

Note

The test is performed by fitting a Cox regression model and reporting its score test. With tied data, this might be slightly different from the true logrank test, but the difference is unimportant in practice.

Author(s)

Göran Broström

See Also

Examples

fit <- logrank(Y = Surv(enter, exit, event), group = civ, 
data = oldmort[oldmort$region == "town", ])
fit

eha

Event History Analysis

v2.10.0
GPL (>= 2)
Authors
Göran Broström [aut, cre], Jianming Jin [ctb]
Initial release
2022-04-17

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.