Performs the log-rank test on survival data, possibly stratified.
logrank(Y, group, data = parent.frame())
| Y | a survival object as returned by the |
|---|---|
| group | defines the groups to be compared. Coerced to a factor. |
| data | a data.frame in which to interpret the variables. |
A list of class logrank with components
The logrank (score) test statistic.
The degrees of freedom of the test statistic.
The p value of the test.
A list of two-column matrices, describing event times and corresponding hazard atoms in each stratum (class 'hazdata').
The call
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.
Göran Broström
#> #> The log-rank test #> #> Call: #> logrank(Y = Surv(enter, exit, event), group = civ, data = oldmort) #> #> X-squared = 16.2888 , df = 2 , p-value = 0.000290358