生存データから分布母数を推定する
最尤法をEstimatedDistributionと一緒に使い,ある打切りデータに最もフィットしたWeibullDistributionを得,それをKaplan–Meier推定値と比べる.
x = 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}];WeibullDistributionを打切りデータにフィットさせる:
dist = EstimatedDistribution[x, WeibullDistribution[α, β]]model = SurvivalModelFit[x]Labeled[Plot[{model[t], SurvivalFunction[dist, t]}, {t, 0, 50}, Exclusions -> None, PlotStyle -> {{Thick, Darker@Blue}, {Thick, Darker@Red}}, Filling -> Axis, ImageSize -> 450, GridLines -> Automatic, GridLinesStyle -> Directive[Dotted], AxesOrigin -> {0, 0}, PlotPoints -> 250, PlotLegends -> Placed[Style[#, Bold, FontFamily -> "Helvetica"]& /@ {"Kaplan-Meier", "WeibullDistribution"}, Below]], Column[{Style["生存曲線推定", Bold, FontFamily -> "Helvetica", FontSize -> 18], Style["パラメトリックとノンパラメトリック", Bold, FontColor -> Gray, FontFamily -> "Helvetica", FontSize -> 14]}], {{Top, Left}}]