Skip to contents

The function does hypothesis tests within blocks and then summarizes the results of this testing across the blocks. It is designed for use by padj_test_fn.

Usage

reveal_po_and_test(
  idat,
  bdat,
  blockid,
  trtid,
  fmla = NULL,
  ybase,
  y1var,
  prop_blocks_0,
  tau_fn,
  tau_size,
  pfn,
  p_adj_method = "fdr",
  afn = NULL,
  splitfn = NULL,
  splitby = NULL,
  thealpha = 0.05,
  copydts = FALSE,
  stop_splitby_constant = FALSE,
  ncores = 1,
  return_details = FALSE
)

Arguments

idat

Individual level data

bdat

Data at the block level.

blockid

A character name of the column in idat and bdat indicating the block.

trtid

Is the name of the treatment numeric, (0,1), variable

fmla

A formula with outcome~treatment assignment where treatment assignment is a factor

ybase

Is the potential outcome to control upon which the treatment effect will be built

y1var

Is the name of the potential outcome to treatment

prop_blocks_0

Is the proportion of blocks with no effects at all

tau_fn

Is a function that turns ybase into the potential outcome under treatment — it is a treatment effect creating function.

tau_size

Is the parameter for the tau_fn — like the true average effect size within a block.

pfn

A function to produce pvalues — using idat.

p_adj_method

Is an input to p.adjust like "fdr" or "holm" to use adjust_block_tests

afn

NULL. Not used. Included here to enable same functions to call this function and reveal_po_and_test_siup

splitfn

Must be null. Only exists so that we can use the same efffect creation and testing function for both approaches.

splitby

Must be null. Only exists so that we can use the same efffect creation and testing function for both approaches.

thealpha

Is the error rate for a given test (for cases where alphafn is NULL, or the starting alpha for alphafn not null)

copydts

TRUE or FALSE. TRUE if using findBlocks standalone. FALSE if copied objects are being sent to findBlocks from other functions.

stop_splitby_constant

FALSE (not used here because this algorithm does not split) is the algorithm should stop splitting when the splitting criteria is constant within set/parent or whether it should continue but split randomly.

ncores

The number of cores or threads to use for the test statistic creation and possible permutation testing

return_details

TRUE means that the function should return a list of the original data ("detobj"), a summary of the results ("detresults"), and a node level dataset ("detnodes"). Default here is FALSE. Only use TRUE when not using simulations.

Value

False positive proportion out of the tests across the blocks, The false discovery rate (proportion rejected of false nulls out of all rejections), the power of the adjusted tests across blocks (the proportion of correctly rejected hypotheses out of all correct hypotheses — in this case correct means non-null), and power of the unadjusted test (proportion correctly rejected out of all correct hypothesis, but using unadjusted p-values).