| regsen_boot | R Documentation |
Computes a non-parametric (or cluster) bootstrap confidence interval for
the breakdown point returned by regsen_breakdown() or the scalar
$breakdown field of regsen_bounds(). Both a bias-corrected and
accelerated (BCa) interval and a percentile interval are returned; type
chooses which one $ci reports.
regsen_boot(
formula,
data,
...,
type = c("bca", "perc"),
R = 999L,
cluster = NULL,
level = 0.95,
seed = NULL,
ncores = NULL,
show_progress = interactive()
)
formula |
Two-sided formula: |
data |
A data.frame. |
... |
Additional arguments forwarded to |
type |
Interval type reported in |
R |
Integer. Number of bootstrap replications. Defaults to 999. |
cluster |
Optional character scalar naming a column of |
level |
Two-sided confidence level for the percentile CI. Default 0.95. |
seed |
Optional integer seed for reproducibility. Results are
identical for a given |
ncores |
Number of cores for the replications and the jackknife.
|
show_progress |
Logical; print progress bar. |
For DMP analyses the breakdown point is computed exactly as in
regsen_breakdown(); when rxbar, rybar and cbar are all scalar the
returned breakdown is the rxbar breakdown for the (scalar) hypothesis on
beta. For Oster analyses the breakdown is the |delta| value at which
the hypothesis first fails.
The BCa interval takes the percentile interval and shifts the quantiles
it reads by two constants: z0, a median-bias correction equal to the
normal quantile of the share of replicates below the point estimate, and
acceleration, computed from the delete-one jackknife over sampling
units – rows, or clusters when cluster is given. The jackknife costs
one breakdown computation per unit, which under an i.i.d. bootstrap
means one per row and usually dominates the run; both it and the
replicates honour ncores, and type = "perc" skips it. When the
jackknife is degenerate (every unit gives the same estimate, so the
acceleration is undefined) the BCa interval falls back to the percentile
interval and acceleration is NA.
An object of class regsensitivity_boot containing: point,
replicates, ci (the interval named by type), ci_bca, ci_perc,
z0, acceleration, type, level, R, cluster, na (the
number of replicates that could not be computed) and infinite (the
number on which the hypothesis survived every value of the sensitivity
parameter; these count as +Inf in the intervals rather than being
dropped).
data(bfg2020)
bfg2020$statea <- factor(bfg2020$statea)
w1 <- c("log_area_2010", "lat", "lon", "temp_mean", "rain_mean",
"elev_mean", "d_coa", "d_riv", "d_lak", "ave_gyi")
form <- reformulate(c("tye_tfe890_500kNI_100_l6", w1, "statea"),
response = "avgrep2000to2016")
set.seed(1)
bb <- regsen_boot(form, bfg2020, compare = w1, cbar = 1,
R = 199, cluster = "km_grid_cel_code")
print(bb)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.