Open javadnoorb opened 6 years ago
For some comparative reason, I needed the "traditional" Greenwood's formula (which made me create a monkey patch for the _bounds
method with the current code base). It would be nice if the user could choose optional methods for the confidence intervals.
Greenwood CI for KM estimator does not work very well with highly censored data and also has asymptotic properties, so doesn't work well for small sample sizes. After playing around with lifelines and getting many NaNs for CIs of highly censored data, I ended up using "Beta Product Confidence Procedure for Right Censored Data" from the following paper: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3769999/
There is an R package to calculate this (which also includes four other CIs): https://cran.r-project.org/web/packages/bpcp/index.html
I'm a Python user so I wrapped this in rpy2. I understand that introduction of new libraries, wrappers or statistical methods may not be appealing, but just checking if there is any interest to incorporate this or any other CIs into lifelines?
Here's a sample of code that can create these CIs: