Implements the residual randomization test. The hypothesis tested is
r_test_c(y, X, lam, lam0, cluster_eps_r, use_perm, use_sign, num_R)
Vector of outcomes (n x 1).
Matrix of covariates (n x p). First column should be 1's.
Vector of coefficients in linear H0 (p x 1).
Scalar value for linear H0.
A List
with restricted residuals. See get_clustered_eps.
Boolean
flag whether to use permutations within clusters.
Boolean
flag whether to use sign flips across clusters.
Integer of how many randomization values to calculate.
A List
with the observed test statistic value (tobs
), and the randomization values (tvals
)
H0: lam' beta = lam[1] * beta[1] + ... + lam[p] * beta[p] = lam0.