Generic residual randomization inference This function provides the basis for all other rrinf* functions.
rrinfBase(y, X, g_or_clust, cover, num_R, control.tinv)
Vector of outcomes (length n)
Covariate matrix (n x p). First column should be ones to include intercept.
Either clustering
or an invariance function that transforms residuals.
Number from [0, 1] that denotes the confidence interval coverage (e.g., 0.95 denotes 95%)
Number of test statistic values to calculate in the randomization test (similar to no. of bootstrap samples).
A List
that determines the test inversion.
Matrix that includes the confidence interval endpoints, and the interval midpoint estimate.
This function has similar funtionality as standard confint. It does so by testing plausible values for each parameter. The plausible values can be controlled as follows. For some parameter beta_i we will test successively
H0: beta_i = hat_beta_i - num_se
* se_i
...up to...
H0: beta_i = hat_beta_i + num_se
* se_i
broken in num_breaks
intervals. Here, hat_beta_i is the OLS estimate of beta_i and se_i is the standard error.
The g_or_clust
object should either be (i) a g-invariance function R^n -> R^n; or (ii)
a list(type, cl) where type=c("perm", "sign", "double") and cl=clustering
(see example_clustering for details).