Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Predicting on right-censored data #128

Closed
jlim13 opened this issue Jul 7, 2020 · 3 comments
Closed

Predicting on right-censored data #128

jlim13 opened this issue Jul 7, 2020 · 3 comments

Comments

@jlim13
Copy link

jlim13 commented Jul 7, 2020

When predicting on right-censored data, is there an option to condition on prior duration like in the lifelines package? Or does the predict function do this conditional for us. https://lifelines.readthedocs.io/en/latest/Survival%20Regression.html#prediction-on-censored-subjects

@sebp
Copy link
Owner

sebp commented Jul 7, 2020

There's no built-in function to do that, but as the lifelines documentation states, all you need to do is divide by S(s). If you have an individual survival function as StepFunction, which predict_survival_function can give you, you just need to evaluate it at s. Once you have S(s), compute S(t) as usual and divide by S(s) from before. Hope that helps.

@jlim13
Copy link
Author

jlim13 commented Jul 7, 2020

so lets say I am predicting an individual's survival function conditioned on them being alive for s days. I would:

  1. call predict_survival_function which gives me S()
  2. get the value at S(s)
  3. divide all of S() by S(s)?

@sebp
Copy link
Owner

sebp commented Jul 8, 2020

Yes, predict_survival_function will give you S (functions) for each sample, from which you can compute S(t) and S(s). You can have a look at the introduction notebook to see how the code would look like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants