不完全なデータから期待生存率を推定する
以下の右打切りデータは,最後の観察が打ち切られているために決してゼロになることがないKaplan–Meier推定値を生成する.期待される寿命を推定するためには,裾の残りの確率のためにモデルを選択しなければならない.これはSurvivalModelFitを使うと簡単に行える.
data = {10, 7, {32, ∞}, 23, 22, 6, 16, {34, ∞}, {32, ∞}, {6, ∞}, {10, ∞}};
𝒮 = SurvivalModelFit[data];
Plot[𝒮[t], {t, 0, 50}, Exclusions -> None, PlotRange -> {0, 1}]tailMods = {ExponentialDistribution[λ], WeibullDistribution[α, β], LogNormalDistribution[μ, σ], GompertzMakehamDistribution[λ, ρ]};
models = Table[SurvivalModelFit[data, Method -> "TailModel" -> i], {i, tailMods}];
colors = ColorData[32, "ColorList"][[-4 ;; -1]];Grid[Partition[MapThread[Labeled[Plot[#1[t], {t, 0, 70}, ImageSize -> 250, Background -> White, FillingStyle -> Lighter@#3, Exclusions -> None, Frame -> True, FrameTicks -> None, GridLines -> Automatic, GridLinesStyle -> Dotted, PlotRange -> {0, 1}, Filling -> Axis], Column[{Style[#2, Bold, FontSize -> 12, FontFamily -> "Helvetica"], Style[Row[{"平均生存率:", #1["MeanSurvival"]}], Bold, FontSize -> 10, FontColor -> Gray, FontFamily -> "Helvetica"]}]]&, {models, tailMods, colors}], 2]]