biclique.decompose: Generate a biclique decomposition given null hypothesis.

View source: R/maintest.R

biclique.decomposeR Documentation

Generate a biclique decomposition given null hypothesis.

Description

Generate a biclique decomposition given null hypothesis.

Usage

biclique.decompose(
  Z,
  hypothesis,
  controls = list(method = "greedy", mina = 10, num_randomizations = 2000),
  stop_Zobs = F
)

Arguments

Z

A vector that gives the realization of treatment assignment. Its length should match Y and is the number of units in the experiment.

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 list(method="greedy", mina=10, num_randomizations=2000). That is, by default it uses greedy decomposition algorithm with mina=10, and the number of randomizations to perform is 2000. See details for further illustration.

stop_Zobs

Whether to stop when the biclique decomposition finds a biclique that contains the observed treatment allocation, Z. Default is FALSE.

Details

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.

Value

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.


dpuelz/CliqueRT documentation built on Jan. 6, 2023, 11:20 p.m.