View source: R/mediation.test.minimax.R
mediation_test_minimax | R Documentation |
\delta_x \times \delta_y=0
" against its alternative
"\delta_x \times \delta_y\neq 0
" based on the test statistic in the
real plane.Carries out the minimax optimal test of the composite null
"\delta_x \times \delta_y=0
" against its alternative
"\delta_x \times \delta_y\neq 0
" based on the test statistic in the
real plane.
mediation_test_minimax(t, alpha = 0.05, truncation = 0, sample_size = Inf)
t |
A |
alpha |
A positive |
truncation |
A nonnegative |
sample_size |
An |
For details, we refer to the technical report "Optimal Tests of the Composite Null Hypothesis Arising in Mediation Analysis", by Miles & Chambaz (2021), https://arxiv.org/abs/2107.07575
A list, consisting of:
a vector
of two
numeric
s, the test statistic, or a 'n x 2' matrix
of such
test statistics;
a numeric
, the type-I error;
a nonnegative numeric
, used to bound the
rejection region away from the null hypothesis space
an integer
, the size of the sample used to
derive the test statistic
a vector
of
logical
s, FALSE
if the null hypothesis can be rejected
for the alternative at level 'alpha' and TRUE
otherwise;
a vector
of numeric
s, the p-values of the
tests;
the character
"minimax".
BH_mediation_test_minimax()
, which builds upon the present function to implement a Benjamini-Hochberg procedure to control false discovery rate.
n <- 10
x <- MASS::mvrnorm(n, mu = c(0, 0), Sigma = diag(c(1, 1)))
delta <- matrix(stats::runif(2 * n, min = -3, max = 3), ncol = 2)
epsilon <- stats::rbinom(n, 1, 1/2)
delta <- delta * cbind(epsilon, 1 - epsilon)
x <- x + delta
(mt <- mediation_test_minimax(x, alpha = 1/20))
plot(mt)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.