-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Labels
Description
I have been using kaplan meier estomators and wrote a small function to evaluate the estimator at any timepoint. I have used this to generate statistics or diagnostic plots.
function evaluate(km_fit::KaplanMeier, t::Real)
time_points = km_fit.events.time
survival = km_fit.survival
if t <= time_points[1]
return 1
else
id = findlast(x -> x <= t, time_points)
return survival[id]
end
end@ararslan if you think this is a usefull feature i can create pull request. I have not looked at the Nelson Aalen estimator but maybe something similar can be done / in general for the nonparametric estimator type.
Reactions are currently unavailable