clique_test_contrast: The main randomization test function for contrast hypothesis.

View source: R/maintest.R

clique_test_contrastR Documentation

The main randomization test function for contrast hypothesis.

Description

The main randomization test function for contrast hypothesis.

Usage

clique_test_contrast(
  Y,
  Z,
  Z_a,
  Z_b,
  Zobs_id,
  Xadj = NULL,
  alpha = 0.05,
  tau = 0,
  decom = "bimax",
  ret_ci = FALSE,
  ci_dec = 2,
  ci_method = "grid",
  ...
)

Arguments

Y

The observed outcome vector.

Z

A binary matrix of dimension (number of units x number of randomizations, i.e. assignments.) storing the assignment vectors. Please see example.

Z_a

A binary matrix with dimension (number of units x number of randomizations, i.e. assignments.) Row i, column j of the matrix corresponds to whether a unit i is exposed to a under assignment j. Please see example.

Z_b

A binary matrix with (number of units x number of randomizations, i.e. assignments.) Row i, column j of the matrix corresponds to whether a unit i is exposed to b under assignment j. Please see example.

Zobs_id

The index location of the observed assignment vector in Z, Z_a, and Z_b.

Xadj

The covariates that might affect Y. If not NULL, will replace Y by the residuals from the linear regression of Y on Xadj. Note that users would need to add an intercept to Xadj manually if they want. To adjust Xadj, pass in adj_Y=TRUE and a non-empty NULL that has the same row numbers as Y.

alpha

The significance level. By default it's 0.05.

tau

The τ in the null Y_i(b) = Y_i(a) + τ for all i. By default is 0.

decom

The algorithm used to calculate the biclique decomposition. Currently supported algorithms are "bimax" and "greedy".

ret_ci

Whether calculates the 1-α confidence interval or not. Default is FALSE.

...

Other stuff ...

Value

A list of items summarizing the randomization test. If for some focal assignments in the biclique that contains Zobs, exposures for each unit are the same, it will contain an error message, and the test decision will be NA.


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