Core engine used by FRTCI and FRTCI_interact to compute
the randomization distribution of a test statistic under permuted
treatment assignments.
generate_permutations(
Y,
Z,
test.stat,
Y0.mat,
Y1.mat,
B,
n.cores,
get.z.star = NULL,
verbose = TRUE,
...
)A list with components:
Observed test statistic.
B x grid.size matrix of permuted test statistics.
Vector of p-values for each grid point.
Outcome vector.
Treatment assignment vector (0/1).
Test statistic function taking (Y, Z, ...).
N x grid.size matrix of imputed control potential outcomes.
N x grid.size matrix of imputed treated potential outcomes.
Number of permutations.
Number of cores for parallel computation.
Optional function to generate permuted Z vectors.
If NULL, uses sample(Z).
Whether to display a progress bar. Default is TRUE.
Additional arguments passed to test.stat.