This is the "core" function of the bmbstats package. It performs bootstrap on the data using provided estimator_function, SESOI_lower_function, and SESOI_upper_function. Used in other functions ("wrappers")

bmbstats(
  data,
  SESOI_lower_function = function(data, na.rm, init_boot) {     return(0) },
  SESOI_upper_function = function(data, na.rm, init_boot) {     return(0) },
  estimator_function = function(data, SESOI_lower, SESOI_upper, na.rm, init_boot) {
    return(0) },
  control = model_control(),
  na.rm = FALSE
)

Arguments

data

Data frame

SESOI_lower_function

Function to estimate SESOI_lower within bootstrap loop. Default functions is function(data, na.rm, init_boot) {return(0)}

SESOI_upper_function

Function to estimate SESOI_upper within bootstrap loop. Default functions is function(data, na.rm, init_boot) {return(0)}

estimator_function

Function to be used within the bootstrap loop to provide a list or named numeric vector of parameters. Default is function(data, SESOI_lower, SESOI_upper, na.rm, init_boot){return(0)}

control

Control object returned from model_control function. Use boot_type, boot_samples, boot_strata to setup bootstrap.

na.rm

Should missing values be removed? Default is FALSE. This is forwarded to estimator_function, SESOI_lower_function, and SESOI_upper_function

Value

A bmbstats object

Examples

bmbstats(iris, SESOI_lower_function = function(data, na.rm, init_boot) { sd(data$Sepal.Length) * -0.2 }, SESOI_upper_function = function(data, na.rm, init_boot) { sd(data$Sepal.Length) * 0.2 }, estimator_function = function(data, SESOI_lower, SESOI_upper, na.rm, init_boot) { list(mean = mean(data$Sepal.Length), SESOI_lower = SESOI_lower, SESOI_upper = SESOI_upper) }, control = model_control(boot_type = "perc", boot_samples = 50) )
#> Bootstraping: 50 resamples
#> Calculating confidence intervals...
#> Done!
#> Bootstrap with 50 resamples and 95% perc confidence intervals. #> #> estimator value lower upper #> mean 5.8433333 5.6959344 6.0118238 #> SESOI_lower -0.1656132 -0.1855872 -0.1433273 #> SESOI_upper 0.1656132 0.1433273 0.1855872