r3d_bootstrap.Rd
Performs a multiplier bootstrap to obtain uniform confidence bands
and (optionally) conduct hypothesis tests for an R3D or F3D design.
It reuses the partial-sum intercept weights and residuals from a fitted r3d
object
to avoid re-estimating local polynomial regressions within each bootstrap loop.
r3d_bootstrap(
object,
X,
Y_list,
T = NULL,
B = 200,
alpha = 0.05,
test = c("none", "nullity", "homogeneity", "gini"),
test_ranges = NULL,
cores = 1,
seed = NULL,
...
)
An S3 object of class "r3d"
, typically the output of r3d
.
Numeric vector of the running variable (the same one used in r3d
).
A list of numeric vectors; each element in this list is the sample from the
outcome distribution of one unit (same data passed to r3d
).
(Optional) numeric or logical vector of treatment statuses for the fuzzy design;
used only if the original r3d
call was fuzzy. Otherwise, can be NULL
.
Integer, number of bootstrap draws. Defaults to 200.
Significance level for uniform confidence bands. Defaults to 0.05.
Character vector indicating which hypothesis tests to conduct:
"none"
No test, only compute confidence bands.
"nullity"
Tests the null \(H_0: \tau(q) = 0 \text{ for all } q\).
"homogeneity"
Tests the null \(H_0: \tau(q) \text{ is constant in } q\).
"gini"
Tests the null \(H_0: \text{Gini coefficient above} = \text{Gini coefficient below}\).
Multiple test types can be specified as a vector, e.g., c("nullity", "homogeneity")
.
List of numeric vectors defining the quantile ranges for testing. Each element should be a
vector of length 2 or more defining the ranges. For example, list(c(0.25, 0.75))
to test on
quantiles between 0.25 and 0.75, or list(c(0.25, 0.5, 0.75))
to test on ranges \[0.25, 0.5\] and \[0.5, 0.75\].
If NULL
(default), tests are performed on the entire q_grid
.
Number of CPU cores used for parallel computation of bootstrap draws (default 1).
Optional integer to set a random seed for the multiplier draws (for reproducibility).
Unused additional arguments (for compatibility).
A list with the elements:
cb_lower
, cb_upper
Numeric vectors giving the lower and upper
uniform confidence bands at each quantile in object$q_grid
.
boot_taus
A matrix of bootstrap-draw realizations of the entire \(\tau(q)\).
supvals
For each bootstrap draw, the supremum (max) absolute deviation.
crit_val
The critical value (e.g., the (1 - alpha)
quantile of supvals
).
test_results
If test
is not "none"
, a list of test results for each test
and range combination, containing the test statistic, critical value, and p-value for each test.
This function implements the multiplier bootstrap approach for distributional RD: it draws i.i.d. normal multipliers \(\xi_i\), re-scales the stored residual partial sums, and reconstructs approximate realizations of the limiting process. The maximum deviation across quantiles in each realization is then used to form uniform confidence bands and test statistics.
For the fuzzy design, the ratio-based estimator is handled similarly, using the same partial-sum logic for the treatment variable.
When multiple tests and/or multiple range specifications are provided, the function will perform each test on each specified range, returning results for all combinations.
The Gini test examines whether there is a statistically significant difference between the Gini coefficients of the estimated quantile functions above and below the cutoff.