Skip to contents

This function creates treatment effects of known forms using existing potential outcomes. We specify differences across blocks and within blocks

Usage

create_effects(
  idat,
  ybase,
  blockid,
  tau_fn,
  tau_size,
  covariate = NULL,
  prop_blocks_0 = 0,
  by_block = TRUE
)

Arguments

idat

Unit-level data. An object inheriting from class data.table

ybase

Baseline potential outcome variable name, a string.

blockid

Name of block variable (the blocking variable is a factor)

tau_fn

A function taking y0 and tau_size to produce a treatment effect for each unit

tau_size

The rough or mean size of the treatment effect (like the mean shift), in sds probably.

covariate

Contains information about covariates currently a character name of a column in idat. It is NULL if not used.

prop_blocks_0

The proportion of blocks having zero treatment effect.

by_block

TRUE if each block has a separate shift (like a mean shift) or to otherwise create the individual level treatment effect separately within block or FALSE to create the effect across all blocks (ignoring blocks).

Value

A data.table with a single column containing potential outcome to treatment.