
Bootstrap Randomization Confidence Intervals
Source:R/inference_all_abstract_rand_bootstrap_ci.R
InferenceRandBootstrapCI.RdThe CI is the set of delta values whose bootstrap randomization p-value exceeds
alpha. All p-value evaluations across candidate delta values share one set
of pre-generated draws (resampled row indices and fresh design assignments) — common
random numbers — so the p-value is a deterministic, near-monotone function of
delta and the bound search is stable. See InferenceRandBootstrap
for the statistical justification of the test being inverted; the resulting interval
inherits its unconditional, superpopulation interpretation and asymptotic validity.
Users do not instantiate this class directly: every concrete inference class in the
package inherits from it, so compute_rand_bootstrap_confidence_interval is
available on any inference object.
Details
Abstract class implementing confidence intervals by inverting the bootstrap
randomization test of InferenceRandBootstrap over the null effect delta.
Super classes
Inference -> InferenceRand -> InferenceRandCI -> InferenceNonParamBootstrap -> InferenceRandBootstrap -> InferenceRandBootstrapCI
Methods
+ inherited public methods from InferenceRandBootstrap
+ inherited public methods from InferenceNonParamBootstrap
InferenceNonParamBootstrap$approximate_bootstrap_distribution_beta_hat_T()InferenceNonParamBootstrap$approximate_m_out_of_n_bootstrap_distribution_beta_hat_T()InferenceNonParamBootstrap$approximate_subsampling_distribution_beta_hat_T()InferenceNonParamBootstrap$compute_bootstrap_confidence_interval()InferenceNonParamBootstrap$compute_bootstrap_two_sided_pval()InferenceNonParamBootstrap$compute_m_out_of_n_bootstrap_confidence_interval()InferenceNonParamBootstrap$compute_m_out_of_n_bootstrap_two_sided_pval()InferenceNonParamBootstrap$compute_subsampling_confidence_interval()InferenceNonParamBootstrap$compute_subsampling_sensitivity()InferenceNonParamBootstrap$compute_subsampling_two_sided_pval()InferenceNonParamBootstrap$get_supported_bootstrap_ci_types()InferenceNonParamBootstrap$get_supported_bootstrap_pval_types()InferenceNonParamBootstrap$select_optimal_b_subsampling()InferenceNonParamBootstrap$select_optimal_m_out_of_n_bootstrap()+ inherited public methods from InferenceRandCI
InferenceRandCI$compute_rand_confidence_interval()InferenceRandCI$compute_rand_two_sided_pval()+ inherited public methods from InferenceRand
+ inherited public methods from Inference
Inference$capabilities()Inference$compute_asymp_confidence_interval()Inference$compute_asymp_two_sided_pval()Inference$compute_estimate()Inference$compute_exact_confidence_interval()Inference$compute_exact_two_sided_pval_for_treatment_effect()Inference$duplicate()Inference$get_analysis_data()Inference$get_covariates()Inference$get_design_object()Inference$get_model_formula()Inference$get_nonestimable_reason()Inference$get_nonestimable_stage()Inference$get_optimization_alg()Inference$get_response()Inference$get_response_type()Inference$get_treatment()Inference$initialize()Inference$is_nonestimable()Inference$set_optimization_alg()Inference$set_seed()Inference$supports()
InferenceRandBootstrapCI$get_supported_rand_bootstrap_ci_types()
Returns the type values
compute_rand_bootstrap_confidence_interval() accepts.
InferenceRandBootstrapCI$compute_rand_bootstrap_confidence_interval()
Computes a confidence interval by inverting the bootstrap randomization
test over the null effect delta. For statistics that are affine in the
additive sharp-null shift (e.g. the simple mean difference and the OLS treatment
coefficient), the inversion is performed in closed form from the breakpoints of the
p-value step function — exact given the draws and requiring no bisection. Otherwise,
the generic bisection search is used. When the p-value does not drop below
alpha / 2 anywhere within the search radius, a conservative bound is returned
at the search boundary rather than NA; each such event emits a
message() and increments the private field
rand_bootstrap_ci_conservative_count.
Usage
InferenceRandBootstrapCI$compute_rand_bootstrap_confidence_interval(
alpha = 0.05,
B = 501,
pval_epsilon = 0.005,
show_progress = TRUE,
max_expansions = 7L,
bootstrap_type = NULL,
zero_one_logit_clamp = .Machine$double.eps,
type = "percentile"
)Arguments
alphaThe confidence level 1 -
alpha. Default 0.05.BNumber of bootstrap randomization draws. Default 501.
pval_epsilonBisection tolerance (on both the
deltabracket width and the p-value span). Default 0.005.show_progressA flag indicating whether progress should be displayed.
max_expansionsMaximum number of bound-doubling expansions when the seed interval does not bracket the target p-value. Default 7.
bootstrap_typeOptional bootstrap-resampling scheme; see
approximate_bootstrap_distribution_beta_hat_Tfor legal values. DefaultNULL.zero_one_logit_clampThe clamping amount for exact 0 and 1 values when logging.
typeCI type.
"percentile"(default) inverts the raw BRT p-value via bisection (or closed-form for affine statistics)."studentized"inverts the signed-pivot BRT p-value \(p(\delta) = 2\min(P(z^0_b \ge z), P(z^0_b \le z))\) where \(z^0_b = (t^0_b(\delta) - \delta)/\hat{s}^0_b\); yields asymmetric CI."symmetric-percentile-t"inverts the absolute-pivot version \(p(\delta) = P(|t^0_b - \delta|/\hat{s}^0_b \ge |t - \delta|/\hat{s})\); yields a CI symmetric around the observed estimate. Both SE-based types pre-compute \(\hat{s}^0_b\) once at \(\delta = 0\) and reuse it across bisection steps. Yield O(\(n^{-1}\)) coverage error versus O(\(n^{-1/2}\)) for"percentile"when the pivot is asymptotically normal. Require the class to expose a standard error; returnNAbounds in harden mode if unavailable."smoothed"adds per-draw kernel noise \(\varepsilon_b \sim N(0, \hat{\sigma}/\sqrt{n})\) to the resampled responses before imposing the null shift, reducing discreteness. Only meaningful for continuous responses. SeeInferenceRandBootstrap'scompute_rand_bootstrap_two_sided_pvalfor the theoretical justification (Silverman 1981; Silverman & Young 1987; Hall, DiCiccio & Romano 1989), an explicit caveat that the bandwidth used here (\(\hat{\sigma}/\sqrt{n}\), fixed, unexposed, with no zero-noise escape hatch) is a pragmatic ad hoc choice rather than one derived from or validated against those sources, and measured performance (this CI, unlike a standalone smoothed p-value, is accelerated by the noise-aware fast kernels: about 50x onn = 30,B = 99).
Returns
A bootstrap randomization confidence interval. The interval lives on the response-transformation scale used by the test (identity for continuous, logit for proportion, log for count and survival). Bounds may be conservative (wider than necessary) when the p-value inversion cannot be completed within the search radius.
Examples
if (FALSE) { # \dontrun{
seq_des = DesignSeqOneByOneKK14$new(n = 100, response_type = "continuous")
# ... run the experiment: add subjects and responses ...
seq_des_inf = InferenceAllSimpleAverageDiff$new(seq_des)
seq_des_inf$compute_rand_bootstrap_confidence_interval(alpha = 0.05, B = 501)
} # }