Description Usage Arguments Value Author(s) References See Also Examples
Function takes a blocking variable and a clustering variable and yields exact probabilities of treatment under complete randomization of clusters within blocks
1 | genprobexact(Z, blockvar = NULL, clustvar = NULL)
|
Z |
binary vector (0 or 1) of length N, treatment indicator |
blockvar |
positive integer vector of length N, with unique values indicating different blocks |
clustvar |
positive integer vector of length N, with unique values indicating different clusters |
numeric vector with values within the (0,1) interval of length N, probability of treatment assignment
Peter M. Aronow <peter.aronow@yale.edu>; Cyrus Samii <cds2083@nyu.edu>
Gerber, Alan S. and Donald P. Green. 2012. Field Experiments: Design, Analysis, and Interpretation. New York: W.W. Norton.
1 2 3 4 5 6 7 | y <- c(8,6,2,0,3,1,1,1,2,2,0,1,0,2,2,4,1,1)
Z <- c(1,1,0,0,1,1,0,0,1,1,1,1,0,0,1,1,0,0)
cluster <- c(1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9)
block <- c(rep(1,4),rep(2,6),rep(3,8))
probs <- genprobexact(Z,block,cluster) # generate probability of assignment
ate <- estate(y,Z,prob=probs) # estimate the ATE; estimated ATE=2
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.