# Performing a Weibull analysis of the Bearing Cage
# failure data as done in Xu et al. (2020)
set.seed(123, "L'Ecuyer-CMRG")
data("bearingcage")
#Set fwb type to "mammen"
op <- set_fwb_wtype("mammen")
weibull_est <- function(data, w) {
fit <- survival::survreg(survival::Surv(hours, failure) ~ 1,
data = data, weights = w,
dist = "weibull")
c(eta = unname(exp(coef(fit))), beta = 1/fit$scale)
}
boot_est <- fwb(bearingcage, statistic = weibull_est,
R = 199, verbose = FALSE)
boot_est
#Get the fwb type used in the bootstrap
get_fwb_wtype(boot_est)
get_fwb_wtype()
#Restore original options
options(op)
get_fwb_wtype()
Run the code above in your browser using DataLab