Learn R Programming

weibulltools (version 1.0.1)

kaplan_method: Estimation of Failure Probabilities using Kaplan-Meier

Description

Whereas the non-parametric Kaplan-Meier estimator is used to estimate the survival function S(t) in terms of (multiple) right censored data, the complement is an estimate of the cumulative distribution function F(t). One modification is made in contrast to the orginial Kaplan-Meier estimator (based on NIST/SEMATECH e-Handbook of Statistical Methods, 8.2.1.5.): If the last unit (unit with highest observed lifetime) is a defective unit, the estimator is adjusted in such a way that the survival estimate for this unit is not zero and therefore the estimate for the failure probability is not equal to one. Otherwise the estimate in this context would be too pessimisitc. Since the failure probability estimation in this function is not based on Median Ranks, the Betabinomial confidence intervals cannot be calculated on the basis of Kaplan-Meier failure probabilities.

Usage

kaplan_method(x, event, id = rep("XXXXXX", length(x)))

Arguments

x

a numeric vector which consists of lifetime data. Lifetime data could be every characteristic influencing the reliability of a product, e.g. operating time (days/months in service), mileage (km, miles), load cycles.

event

a vector of binary data (0 or 1) indicating whether unit i is a right censored observation (= 0) or a failure (= 1).

id

a character vector for the identification of every unit.

Value

A data frame containing id, lifetime characteristic, status of the unit and the estimated failure probabilty. For right censored observations the cells of probability column are filled with NA.

References

NIST/SEMATECH e-Handbook of Statistical Methods, 8.2.1.5. Empirical model fitting - distribution free (Kaplan-Meier) approach, https://www.itl.nist.gov/div898/handbook/apr/section2/apr215.htm, 30/04/2018

Examples

Run this code
# NOT RUN {
# Example 1
obs   <- seq(10000, 100000, 10000)
state <- c(0, 1, 1, 0, 0, 0, 1, 0, 1, 0)
uic   <- c("3435", "1203", "958X", "XX71", "abcd", "tz46",
           "fl29", "AX23","Uy12", "kl1a")

df_kap <- kaplan_method(x = obs, event = state, id = uic)

# Example 2
 df <- data.frame(obs = c(10000, 10000, 20000, 20000, 30000,
                         30000, 30000, 30000, 40000, 50000,
                         50000, 60000, 70000, 70000, 70000,
                         70000, 80000, 80000, 80000, 80000,
                         90000, 90000, 100000),
                 state = rep(1, 23))

df_kap2 <- kaplan_method(x = df$obs, event = df$state)
# }

Run the code above in your browser using DataLab