clique_test | R Documentation |
The generalized main randomization test function.
clique_test(Y, Z, teststat, biclique_decom, alpha = 0.05, one_sided = T)
Y |
The observed outcome vector. |
Z |
A vector that gives the realization of treatment assignment. Its length should match |
teststat |
The test statistic used. See details for further illustration. |
biclique_decom |
Output from |
alpha |
The significance level. By default it's |
one_sided |
Logical, whether to use a one-sided p-value or a two-sided p-value.
Default is |
teststat
specifies the test statistic used in the conditional clique.
By default, one_sided
is set to be TRUE
, which calculates the p-value by the function
one_sided_test
. It hence requires that a large value of the test statistic provides evidence against
the null hypothesis. However, the user can choose other statistics and use the two-sided p-value by
setting one_sided=F
, which calculates the p-value by two_sided_test
.
It should contain at least (with order) y, z, focal_unit_indicator
as inputs,
where y
is the outcome vector, z
is the treatment vector
and focal_unit_indicator
is a 0-1 vector indicating whether a unit is focal (=1) or not (=0). All three inputs
should have length equal to number of units and have the same ordering.
Users may use other global variables in the function, such as adjacency matrix of the network, but they do not need to be written as parameters of the function.
We provide several default test statistics for no-interference null that can be generated using
function gen_tstat
.
Sometimes the test statistic or its randomization distribution contains NA.
It may be due to poor selection of focals. In this case the returned p.value
is set to be 3
and the user may consider rerun the biclique decomposition.
It might also happen that the randomization distribution is degenerate, which means that the resampled
test statistics are all identical, and the p-value will not be available. In this case
the returned p.value
is set to be 2 and the user may consider changing the test statistic used.
A list of items summarizing the randomization test. It contains the p-value p.value
,
test statistic statistic
, the randomization distribution of the test statistic statistic.dist
,
and a list MNE
of clique decomposition. Each element of MNE
records one biclique decomposed
from a multi-null exposure graph and contains its focal units and focal assignments.
gen_tstat, one_sided_test
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.