Skip to contents

The 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
+ 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


InferenceRandBootstrapCI$get_supported_rand_bootstrap_ci_types()

Returns the type values compute_rand_bootstrap_confidence_interval() accepts.

Usage

InferenceRandBootstrapCI$get_supported_rand_bootstrap_ci_types()


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

alpha

The confidence level 1 - alpha. Default 0.05.

B

Number of bootstrap randomization draws. Default 501.

pval_epsilon

Bisection tolerance (on both the delta bracket width and the p-value span). Default 0.005.

show_progress

A flag indicating whether progress should be displayed.

max_expansions

Maximum number of bound-doubling expansions when the seed interval does not bracket the target p-value. Default 7.

bootstrap_type

Optional bootstrap-resampling scheme; see approximate_bootstrap_distribution_beta_hat_T for legal values. Default NULL.

zero_one_logit_clamp

The clamping amount for exact 0 and 1 values when logging.

type

CI 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; return NA bounds 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. See InferenceRandBootstrap's compute_rand_bootstrap_two_sided_pval for 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 on n = 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.


InferenceRandBootstrapCI$clone()

The objects of this class are cloneable with this method.

Usage

InferenceRandBootstrapCI$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

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)
} # }