« View all new features in
Mathematica
9
◄
previous
|
next
►
New in
Mathematica
9
›
Survival Analysis
Compare Survival Rates of Treatment and Control Groups
Use
SurvivalModelFit
to visually compare survival curves with confidence bands for treatment and control groups.
In[1]:=
X
trt = EventData[{10, 7, 32, 23, 22, 6, 16, 34, 32, 25, 11, 20, 19, 6, 17, 35, 6, 13, 9, 6, 10}, {0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1}]; ctr = EventData[{1, 22, 3, 12, 8, 17, 2, 11, 8, 12, 2, 5, 4, 15, 8, 23, 5, 11, 4, 1, 8}];
Gehan's weighted
LogRankTest
agrees with the visual that there is a significant difference in the hazard rates.
In[2]:=
X
LogRankTest[{trt, ctr}, "Gehan", "TestDataTable"]
Out[2]=