rrinfBase {RRI} | R Documentation |
Generic residual randomization inference This function provides the basis for all other rrinf* functions.
Description
Generic residual randomization inference This function provides the basis for all other rrinf* functions.
Usage
rrinfBase(y, X, g_or_clust, cover, num_R, control.tinv)
Arguments
y |
Vector of outcomes (length n) |
X |
Covariate matrix (n x p). First column should be ones to include intercept. |
g_or_clust |
Either |
cover |
Number from [0, 1] that denotes the confidence interval coverage (e.g., 0.95 denotes 95%) |
num_R |
Number of test statistic values to calculate in the randomization test (similar to no. of bootstrap samples). |
control.tinv |
A |
Details
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).
https://www.ptoulis.com/residual-randomization
Value
Matrix that includes the confidence interval endpoints, and the interval midpoint estimate.