biclique.decompose | R Documentation |
Generate a biclique decomposition given null hypothesis.
biclique.decompose( Z, hypothesis, controls = list(method = "greedy", mina = 10, num_randomizations = 2000), stop_Zobs = F )
Z |
A vector that gives the realization of treatment assignment. Its length should match |
hypothesis |
A list that contains three functions specifyting the experiment design and null hypothesis. See details for further illustration. |
controls |
A list that contains settings for biclique decomposition and covariates adjustment.
By default it is |
stop_Zobs |
Whether to stop when the biclique decomposition finds a biclique that contains the observed
treatment allocation, |
hypothesis
contains three functions:
design_fn
A function that returns a realization of treatment for the whole sample. For example,
if each unit has equal probability 0.2 to receive the treatment independently, we can write
design_fn = function() { rbinom(num_units, 1, prob=0.2) }
.
exposure_i
A function that returns exposure f_i(z) of unit i under treatment z where
z is the treatment for the whole sample. The inputs of the function are an index i
and
a vector z
. For example, if the exposure of i under z is the treatment it receives, then
we can write exposure_i = function(z, i) { z[i] }
. See more examples in the README file.
null_equiv
A function that takes two inputs from exposure_i
and determines
whether f_i(z_1) is equivalent to f_i(z_2) under the null hypothesis. For example, if the
null is "extent of interference" type of null, we can write
null_equiv = function(e1, e2) {identical(e1, e2)}
.
controls
contains several components:
method
Specifies the decomposition method. Should be either "bimax"
or "greedy"
.
minr
,minc
or mina
If "bimax"
is used, minr
and minc
should be supplied that specify the minimum number of units and assignments
in the bicliques found by the algorithm. If "greedy"
is used, mina
should be supplied.
num_randomizations
Number of randomizations to perform. If it is not specified, will be set
to be 2000 by default.
(optional) Xadj
The covariates that might affect Y. If it is specified in controls
,
will replace Y
by the residuals from the linear regression of Y
on Xadj
(number of rows in Y
and in Xadj
should be the same).
Note that users would need to add an intercept to Xadj
manually if they want.
a list MNE
of clique decomposition and specified controls
.
Each element of MNE
records one biclique decomposed from a multi-null exposure
graph and contains its focal units and focal assignments.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.