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

Calculating Estimated Population Survival Curve #165

Open
puckybreg opened this issue May 29, 2023 · 4 comments
Open

Calculating Estimated Population Survival Curve #165

puckybreg opened this issue May 29, 2023 · 4 comments

Comments

@puckybreg
Copy link

puckybreg commented May 29, 2023

Hi Pycox Community!

I am working on a project applying survival analysis to the dwell times of insects and have found the PyCox package quite useful.
I have mostly been following along with the simplest example from 01_introduction.ipynb but have had to make some inferences on the Population Survival Curve.

In the tutorial, the predicted survival curves of the test data are built and the graphed indivudally. I am hoping to come up with an estimated Population Survival Curve. Is this as simple as taking the mean of our predicted survival curves?

surv = model.predict_surv_df(x_test)
surv['mean'] = surv.mean(axis=1)
surv['mean'].plot(drawstyle='steps-post')

Let me know your thoughts.

@sourasen1011
Copy link

Not sure if this is the answer you are looking for, but if you are looking for a Population survival curve, sounds like a non-parametric estimator such as the Kaplan Meier or Nelson Aalen may be good for you. The Kaplan Meier one doesn't consider any covariates - it just plots the survival at each observed event time as the cumulative product of previous survivals (starting with 1, of course).

@alexxiecan
Copy link

Hello, deer puckybreg and everyone
The demo of the deepsurvey model draws an individual survival curve, and I also hope to be able to draw a curve for the entire population. Do you know if anyone else has a good solution?
sincerely !!!! thanks

@alexxiecan
Copy link

dear

@shahidhaider-altis
Copy link

I concur with @sourasen1011
You are looking for something like a KM curve, which is a non-parametric estimator for the population survival curve

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

4 participants