Learn R Programming

survexp.fr (version 1.1)

LR: Log-Rank test between an observed and an expected survival curve

Description

Log-Rank test between an observed and an expected survival curve

Usage

LR(futime, status, age, sex, entry_date, ratetable = survexp.fr::survexp.fr)

Value

A list containing the observed number of deaths, the expected number of deaths, the Log-Rank statistic and its p-value

Arguments

futime

follow-up time of the subjects in days

status

0 if censored or 1 if dead at futime

age

age in days

sex

"male" or "female"

entry_date

entry date in the study

ratetable

a table of event rates, such as survexp.fr or survexp.us

Author

Hugo Varet

Details

The Log-Rank is calculated as: $$LR = (O-E)^2/E$$ where \(O\) is the observed number of deaths and \(E\) is the expected number based on the patients' characteristics (sex, age and entry date in the study). It follows a Khi-2 distribution with one degree of freedom, which allows to compute its p-value.

References

R. Peto and J. Peto, Asymptotically Efficient Rank Invariant Test Procedures, Journal of the Royal Statistical Society, 1972

Examples

Run this code
attach(data.example)
LR(futime, status, age, sex, entry_date)

Run the code above in your browser using DataLab