bsw()bootbsw() applies nonparametric bootstrapping to an object of class "bsw"
and computes bias-corrected accelerated confidence intervals (BCa) for the estimated Relative Risk.
bootbsw(object, ci_level = 0.95, R = 1000L, maxit = NULL, conswitch = NULL)An object of class "bsw_boot", which is a list containing:
The original call to the bsw() function used to fit the model.
The number of bootstrap replicates that were completed successfully.
A character string with a status message indicating how many bootstrap samples succeeded.
A matrix with the original estimated model parameters (Orig. Est.), the mean of the bootstrap estimates (Boot. Est.), the standard error of the bootstrap estimates (Boot. SE), the difference between the bootstrap mean and the original estimate (bias), the Risk Difference (equal to the estimate; RD), and the bias-corrected accelerated confidence intervals at the specified level.
An object of class "boot" (from the boot package) containing the full bootstrap output,
including replicates and metadata. This can be used for further analyses or plotting.
An object of the class "bsw".
A value between 0 and 1 indicating the confidence interval.
Provides bias-corrected accelerated bootstrap confidence intervals
of the original estimated model parameters of bsw().
A positive integer greater than or equal to 1000 giving the number of bootstrap replicates.
A positive integer giving the maximum number of iterations in the bsw() algorithm.
If NULL (the default), the value stored in the bsw object is passed internally to bootbsw().
Specifies how the constraint matrix is constructed:
Generates all possible combinations of minimum and maximum values for the predictors (excluding the intercept), resulting in \(2^{m-1}\) constraints. This formulation constrains model predictions within the observed data range, making it suitable for both risk factor identification and prediction (prognosis).
Uses the raw design matrix x as the constraint matrix, resulting in \(n\) constraints.
This is primarily suitable for identifying risk factors, but not for prediction tasks, as predictions are not bounded to realistic ranges.
If NULL (the default), the value stored in the bsw object is passed internally to bootbsw().
Julius Johannes Weise, Thomas Wolf, Stefan Wagenpfeil
# \donttest{
set.seed(123)
x <- rnorm(100, 50, 10)
y <- rbinom(100, 1, exp(-4 + x * 0.04))
fit <- bsw(formula = y ~ x, data = data.frame(y = y, x = x))
result <- bootbsw(fit, ci_level = 0.90)
print(result)
# }
Run the code above in your browser using DataLab