-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
it would be nice to have a function that adds the baseline H_0 function. this is a rough draft of the breslow estimator for that end:
function _breslow_est(model::SurvivalModels.CoxModel, t)
r = 0.0
exp_pred = exp.(model.des * model.par)
for ti in model.times
if ti < t
num = 0.0
den = 0.0
for j in eachindex(model.times)
num += model.status[j] * (model.times[j]=ti)
den += exp_pred[j] * (model.times[j]>=ti)
end
r += num / den
end
end
return r
end
survival_curve(model::SurvivalModels.CoxModel, t, X) = exp(-_breslow_est(model, t) * exp(X' * model.par))Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels