blockTools: Blocking, Assignment, and Diagnosing Interference in Randomized Experiments.
Version 0.4-1
Available as a CRAN package.
28 October 2009
Estimates from randomized experiments constitute the gold standard in social and biomedical research. blockTools offers functionality for designing, conducting, and analyzing aspects of randomized experiments. "Blocking" involves sorting experimental units into homogeneous groups prior to randomization. Randomization then occurs within those groups. blockTools allows experimentalists to easily
block experimental units using many background covariates simultaneously (including continuous ones)
incorporate substantive knowledge via weights on variables
randomly assign blocked units to treatment conditions within blocks
detect possible interference between treatment and control units ("contamination", or "spillovers")
quickly write tables of proposed blocks or experimental assignment protocols to .tex or .csv files
Documentation
The many options associated with this functionality are detailed in the blockToolsmanual.
Installation
To install and load blockTools, open R and type
> install.packages("blockTools") > library(blockTools)
Using blockTools
There are 3 primary functions of blockTools: block, assignment, and diagnose.
block creates experimental blocks.
assignment assigns one unit in each block to each treatment condition.
diagnose detects units of different treatment assignments that are "too close" or "too far away" from each other on some variable.
Examples
At the R prompt, type: > data(x100) ## load the example data > out <- block(x100, id.vars = "id", block.vars = c("b1", "b2")) ## create blocked pairs > assg <- assignment(out) ## assign one member of each pair to treatment/control > diag <- diagnose(assg, x100, id.vars = "id", suspect.var = "b1", suspect.range = c(0,1)) ## detect unit pairs with different treatment assignments that are within 1 unit of each other on variable "b1"
To view the results: > out$blocks ## blocked pairs > assg ## assigned pairs > diag ## pairs with small distances on covariates between them
Citation
If you use this package, please cite as
Moore, Ryan T. "blockTools: Blocking, Assignment, and Diagnosing Interference in Randomized Experiments", Version 0.4-1, October 2009.
For an application, see:
King, Gary, Emmanuela Gakidou, Nirmala Ravishankar, Ryan T. Moore, Jason Lakin, Manett Vargas, Martha María Téllez-Rojo, Juan Eugenio Hernández Ávila, Mauricio Hernández Ávila and Héctor Hernández Llamas. 2007. "A 'Politically Robust' Experimental Design for Public Policy Evaluation, with Application to the Mexican Universal Health Insurance Program". Journal of Policy Analysis and Management, 26(3): 479-509.