# KaplanMeier¶

class reliability.Nonparametric.KaplanMeier(failures=None, right_censored=None, show_plot=True, print_results=True, plot_CI=True, CI=0.95, plot_type='SF', **kwargs)

Uses the Kaplan-Meier estimation method to calculate the reliability from failure data. Right censoring is supported and confidence bounds are provided. The confidence bounds are calculated using the Greenwood formula with Normal approximation, which is the same as featured in Minitab. The Kaplan-Meier method provides the SF. With a little algebra, the CDF and CHF are also obtained from the SF. It is not possible to obtain a useful version of the PDF or HF as the derivative of a stepwise function produces very spikey functions.

Inputs: failures - an array or list of failure times. Sorting is automatic so times do not need to be provided in any order. right_censored - an array or list of right censored failure times. Defaults to None. show_plot - True/False. Default is True. Plots the CDF, SF, or CHF as specified by plot_type. plot_type - SF, CDF, or CHF. Default is SF. print_results - True/False. Default is True. Will display a pandas dataframe in the console. plot_CI - shades the upper and lower confidence interval CI - confidence interval between 0 and 1. Default is 0.95 for 95% CI.

Outputs: results - dataframe of results for the SF KM - list of Kaplan-Meier column from results dataframe. This column is the non parametric estimate of the Survival Function (reliability function). xvals - the x-values to plot the stepwise plot as seen when show_plot=True SF - survival function stepwise values (these differ from the KM values as there are extra values added in to make the plot into a step plot) CDF - cumulative distribution function stepwise values CHF - cumulative hazard function stepwise values SF_lower - survival function stepwise values for lower CI SF_upper - survival function stepwise values for upper CI CDF_lower - cumulative distribution function stepwise values for lower CI CDF_upper - cumulative distribution function stepwise values for upper CI CHF_lower - cumulative hazard function stepwise values for lower CI CHF_upper - cumulative hazard function stepwise values for upper CI

Example Usage: f = [5248,7454,16890,17200,38700,45000,49390,69040,72280,131900] rc = [3961,4007,4734,6054,7298,10190,23060,27160,28690,37100,40060,45670,53000,67000,69630,77350,78470,91680,105700,106300,150400] KaplanMeier(failures = f, right_censored = rc)