Quantify Relative Risk Using a Cox-Proportional Hazards Model
Quantify Relative Risk Using a Cox-Proportional Hazards Model
Compare survival rates for different stages of cancer of the larynx for 50-year-old patients using CoxModelFit.
larynx = ExampleData[{"Statistics", "LarynxCancer"}];
ξ = larynx[[All, {1, 3}]];
e = EventData[larynx[[All, 2]], larynx[[All, 5]]];
cox = CoxModelFit[{ξ, e}, {stage, age}, {stage, age}, NominalVariables -> stage];Labeled[Plot[Evaluate@Table[cox["SF"][{i, 50}][t], {i, 4}], {t, 0, 12}, Exclusions -> None, PlotRange -> {0, 1}, PlotStyle -> Thick, PlotLegends -> Placed[Table[Style[Row[{"Stage ", i}], Bold, FontFamily -> "Helvetica"], {i, 4}], Below], PlotPoints -> 500, ImageSize -> 450, GridLines -> Automatic, GridLinesStyle -> Directive[Gray, Dotted], Frame -> True], Column[{Style["Larynx Cancer Survival by Stage", Bold, FontSize -> 18, FontFamily -> "Helvetica"], Style["Males at Age 50", Bold, FontSize -> 14, FontColor -> Gray, FontFamily -> "Helvetica"]}], {{Top, Left}}]The parameter table suggests those with stage 4 cancer have about 5.4 times the risk of dying as those in stage 1:
cox["ParameterTable"]