Skip to content

Commit

Permalink
Merge pull request #422 from javadnoorb/patch-1
Browse files Browse the repository at this point in the history
Update Survival analysis with lifelines.rst
  • Loading branch information
CamDavidsonPilon committed Mar 8, 2018
2 parents bbd7e5a + 54fa651 commit 4d22dd9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/Survival analysis with lifelines.rst
Expand Up @@ -259,7 +259,7 @@ see that very few leaders make it past 20 years in office. Of course,
like all good stats, we need to report how uncertain we are about these
point estimates, i.e., we need confidence intervals. They are computed in
the call to ``fit``, and located under the ``confidence_interval_``
property. (The mathematics are found in `these notes <http://courses.nus.edu.sg/course/stacar/internet/st3242/handouts/notes2.pdf>`_.)
property. (The method uses exponential Greenwood confidence interval. The mathematics are found in `these notes <https://www.math.wustl.edu/%7Esawyer/handouts/greenwood.pdf>`_.)

.. math:: S(t) = Pr( T > t)

Expand Down
4 changes: 3 additions & 1 deletion lifelines/fitters/kaplan_meier_fitter.py
Expand Up @@ -90,7 +90,9 @@ def fit(self, durations, event_observed=None, timeline=None, entry=None, label='
return self

def _bounds(self, cumulative_sq_, alpha, ci_labels):
# See http://courses.nus.edu.sg/course/stacar/internet/st3242/handouts/notes2.pdf
# This method calculates confidence intervals using the exponential Greenwood formula.
# See https://www.math.wustl.edu/%7Esawyer/handouts/greenwood.pdf

alpha2 = inv_normal_cdf((1. + alpha) / 2.)
df = pd.DataFrame(index=self.timeline)
v = np.log(self.__estimate.values)
Expand Down

0 comments on commit 4d22dd9

Please sign in to comment.