LogRankTest

LogRankTest[{data1,data2,}]
tests for equal hazard rates among the using a log-rank type test.

LogRankTest[{data1,data2,},wspec]
performs a weighted log-rank test with weights wspec.

LogRankTest[{data1,},wspec,"property"]
returns the value of .

Details and OptionsDetails and Options

  • LogRankTest performs a hypothesis test on the with null hypothesis that the true hazard rates of the populations are equal for all and alternative hypothesis that at least one is different for some value of .
  • The number is generally taken to be the largest event time in the .
  • By default, a probability value or -value is returned.
  • A small -value suggests that it is unlikely that is true.
  • The must be univariate .
  • The can be a SparseArray or EventData object.
  • LogRankTest is effectively based on where , , and are the observed number of events, the expected number of events based on the pooled sample, and some weights, respectively.
  • For named weight methods, the weight at time , , is generally based on the number at risk , the number of events , the product limit estimator of the pooled sample, or a similar estimator of the pooled sample.
  • The following weight specifications wspec can be given:
  • ρFlemingHarrington weights with
    {ρ,γ}fully specified FlemingHarrington weights
    "name"use a named weight method
  • The values of ρ and γ can be any non-negative numbers.
  • Specifying ρ and γ yields FlemingHarrington weights of the form .
  • Possible named weight specifications include:
  • "AndersenPeto"y_(i)s^~(t_(i))/(y_(i)+1)
    "Equal"
    "Gehan"
    "Peto"
    "TaroneWare"
  • For interval-censored data the ZhaoZhaoSunKim generalized log-rank test is used.
  • LogRankTest[{data1,},wspec,"HypothesisTestData"] returns a HypothesisTestData object htd that can be used to extract additional test results and properties using the form htd["property"].
  • LogRankTest[{data1,},wspec,"property"] can be used to directly give the value of .
  • Properties related to the reporting of test results include:
  • "AllTests"list of all applicable tests
    "AutomaticTest"test chosen if Automatic is used
    "DegreesOfFreedom"the degrees of freedom used in a test
    "EventTimes"list of time points used in the test
    "EventWeights"a list of weights used at each event time
    "PValue"list of -values
    "PValueTable"formatted table of -values
    "ShortTestConclusion"a short description of the conclusion of a test
    "TestConclusion"a description of the conclusion of a test
    "TestData"list of pairs of test statistics and -values
    "TestDataTable"formatted table of -values and test statistics
    "TestStatistic"list of test statistics
    "TestStatisticTable"formatted table of test statistics
  • The following options can be given:
  • MethodAutomaticthe method to use for computing -values
    SignificanceLevel0.05cutoff for diagnostics and reporting

ExamplesExamplesopen allclose all

Basic Examples  (4)Basic Examples  (4)

Compare hazard rates using some sample data:

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=

Create a HypothesisTestData object for repeated property extraction:

In[3]:=
Click for copyable input
Out[3]=
In[4]:=
Click for copyable input
Out[4]=

Test some censored data:

In[1]:=
Click for copyable input

A significant difference is detected at the 5% level:

In[2]:=
Click for copyable input
Out[2]=

Perform a weighted log-rank test:

In[1]:=
Click for copyable input

Use a named weight scheme:

In[2]:=
Click for copyable input
Out[2]=

Use FlemingHarrington weights:

In[3]:=
Click for copyable input
In[4]:=
Click for copyable input
Out[4]=

Test for equal hazard rates with many samples:

In[1]:=
Click for copyable input

A visual comparison of the survival rates:

In[2]:=
Click for copyable input
Out[2]=

A significant difference is not detected:

In[3]:=
Click for copyable input
Out[3]=
Introduced in 2012
(9.0)