genprobexact: Production of exact probabilities of treatment assignment for...

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/genprobexact.R

Description

Function takes a blocking variable and a clustering variable and yields exact probabilities of treatment under complete randomization of clusters within blocks

Usage

1
genprobexact(Z, blockvar = NULL, clustvar = NULL)

Arguments

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

Value

numeric vector with values within the (0,1) interval of length N, probability of treatment assignment

Author(s)

Peter M. Aronow <peter.aronow@yale.edu>; Cyrus Samii <cds2083@nyu.edu>

References

Gerber, Alan S. and Donald P. Green. 2012. Field Experiments: Design, Analysis, and Interpretation. New York: W.W. Norton.

See Also

genprob

Examples

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

Example output



ri documentation built on May 2, 2019, 6:51 a.m.