コックス比例ハザードモデルを使って相対リスクを定量化する
CoxModelFitを使って50歳の喉頭癌患者の癌のさまざまな病期について生存率を比べる.
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[{"病期", i}], Bold, FontFamily -> "Helvetica"], {i, 4}], Below], PlotPoints -> 500, ImageSize -> 450, GridLines -> Automatic, GridLinesStyle -> Directive[Gray, Dotted], Frame -> True], Column[{Style["病期ごとの喉頭癌生存率", Bold, FontSize -> 18, FontFamily -> "Helvetica"], Style["50歳の男性", Bold, FontSize -> 14, FontColor -> Gray, FontFamily -> "Helvetica"]}], {{Top, Left}}]cox["ParameterTable"]