BreslowFlemingHarringtonFitter¶
- class lifelines.fitters.breslow_fleming_harrington_fitter.BreslowFlemingHarringtonFitter(alpha: float = 0.05, label: str = None)¶
Class for fitting the Breslow-Fleming-Harrington estimate for the survival function. This estimator is a biased estimator of the survival function but is more stable when the population is small and there are too few early truncation times, it may happen that is the number of patients at risk and the number of deaths is the same.
Mathematically, the Nelson-Aalen estimator is the negative logarithm of the Breslow-Fleming-Harrington estimator.
- Parameters:
alpha (float, optional (default=0.05)) – The alpha value associated with the confidence intervals.
- fit(durations, event_observed=None, timeline=None, entry=None, label=None, alpha=None, ci_labels=None, weights=None, fit_options=None)¶
- Parameters:
durations (an array, or pd.Series, of length n) – duration subject was observed for
timeline – return the best estimate at the values in timelines (positively increasing)
event_observed (an array, or pd.Series, of length n) – True if the the death was observed, False if the event was lost (right-censored). Defaults all True if event_observed==None
entry (an array, or pd.Series, of length n) – relative time when a subject entered the study. This is useful for left-truncated observations, i.e the birth event was not observed. If None, defaults to all 0 (all birth events observed.)
label (string) – a string to name the column of the estimate.
alpha (float, optional (default=0.05)) – the alpha value in the confidence intervals. Overrides the initializing alpha for this call to fit only.
ci_labels (iterable) – add custom column names to the generated confidence intervals as a length-2 list: [<lower-bound name>, <upper-bound name>]. Default: <label>_lower_<alpha>
fit_options – Not used.
- Return type:
self, with new properties like
survival_function_
.
- survival_function_at_times(times, label=None) Series ¶
Return a Pandas series of the predicted survival value at specific times
- Parameters:
times (iterable or float)
label (str)