help randinfVersion 0.1.7

Title

randinf -- Calculates the treatment effect and p-value using Fisher's Randomization Test for stratified randomized controlled experiments (see Imbens & Rubin, 2015).

Syntax

randinf [if] [in] ,
treat(treatvar)
outcome(dependentvar)
strata(stratavar)
[iter(num)
granularity(num)
miss
covars(covars)
displayprogress
onesided
resid(residvar)
nofigure]

Description

randinf is a method for calculating the treatment effect and p-value of a stratified randomized controlled experiment using Fisher's Randomization Test under the sharp null hypothesis (see Imbens & Rubin, 2015).
This function uses rank-sum test statistics to evaluate if the difference between any two experimental conditions is significant, first using a sharp null hypothesis of no effect and then iterating through
null hypotheses of various constant treatment effects. Namely, the function will test a wide range of constant treatment effects. The constant treatment effect with the highest probability
in a randomly permuted null distribution will be outputted as the final treatment effect. This command generates a figure showing the probabilities of each treatment effect and highlighting the final treatment effect.

Options

treat(treatvar) name of the treatment variable; must be binary

outcome(dependentvar) name of the outcome or dependent variable

strata(stratavar) name of the strata variable

iter(num) number of iterations used to construct null distribution; default is 1000

granularity(num) the precision on the treatment effect; default is .05. This setting also specifies
the step size of each successive constant treatment effect tested. Lower numbers yield greater precision but take longer to calculate.

miss do not omit strata with missing values

covars(covars) optional covariate adjustment used to calculate residuals. NOTE: You must specify whether each variable is categorical or continuous using
the i. (categorical) and c. (continuous) prefixes. If left unspecified, the strata variable is used to calculate residuals as a set of dummy variables.

displayprogress show covariate regression and iteration through possible treatment effects

onesided one-sided significance test (default is two-sided)

resid(residvar) specify custom residuals

nofigure suppresses the figure

Examples

. randinf, treat(treat) dv(voted) strata(congressionaldistrict)

. randinf, treat(treat) dv(voted) strata(congressionaldistrict) covars(i.voted08 c.age)

Saved Results

randinf saves the following in e():

Scalars

e(tau) treatment effect

e(pvalue) p-value

Notes

This package requires the package shufflevar. If shufflevar is missing from your installation of Stata, randinf installs shufflevar from SSC.

This package does not set the seed or the sortseed, so when you require replicability, please set both the seed and the sortseed.

References

Imbens, G. W., & Rubin, D. B. (2015). Causal Inference in Statistics, Social, and Biomedical Sciences. Cambridge University Press. Chapter 5.

Authors

John Ternovski

Harvard University

johnt1@gmail.com

Thanks

Special thanks to Avi Feller (University of California, Berkeley) for his guidance on the statistical side of things.
Additionally, I am grateful to Chris Kennedy (University of California, Berkeley) and Josh Kalla (University of California, Berkeley) for their feedback and comments.