Skip to contents

Repeat experiment, reveal treatment effects from the potential outcomes, test within partitions, summarize

Usage

reveal_po_and_test_siup(
  idat,
  bdat,
  blockid,
  trtid,
  fmla = Y ~ newZF | blockF,
  ybase,
  y1var,
  prop_blocks_0,
  tau_fn,
  tau_size,
  pfn,
  afn,
  p_adj_method = "split",
  copydts = FALSE,
  splitfn,
  splitby,
  thealpha = 0.05,
  stop_splitby_constant = TRUE,
  ncores = 1,
  return_details = FALSE
)

Arguments

idat

Data at the unit level.

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 | block where treatment assignment and block must be factors. (NOT USED HERE)

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.

afn

A function to adjust alpha at each step. Takes one or more p-values plus a stratum or batch indicator.

p_adj_method

Must be "split" here.

copydts

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

splitfn

A function to split the data into two pieces — using bdat

splitby

A string indicating which column in bdat contains a variable to guide splitting (for example, a column with block sizes or block harmonic mean weights or a column with a covariate (or a function of covariates))

thealpha

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

stop_splitby_constant

TRUE 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).

Details

The function does hypothesis tests within partitions of blocks (including individual blocks depending on the splitting algorithm) and then summarizes the results of this testing across the blocks. It very much depends on padj_test_fn.