gendist: Generates randomization distribution of estimated ATEs

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

View source: R/gendist.R

Description

Takes hypothesized potential outcomes, a permutation matrix, and arguments for estate() to produce a randomization distribution of estimated average treatment effects (ATEs).

Usage

1
gendist(Ys, perms, X = NULL, Ypre = NULL, prob = NULL, HT = FALSE)

Arguments

Ys

list consisting of two N-length numeric vectors labeled Y0 and Y1, as output by genouts()

perms

N-by-r permutation matrix, as output by genperms or genperms.custom

X

N-by-k numeric matrix of covariates for regression adjustment

Ypre

numeric vector of length N, pretreatment measure of the outcome variable for difference estimation

prob

numeric vector within the (0,1) interval of length N, probability of treatment assignment, as output by genprob() or genprobexact(). When prob=NULL (by default), assumes probability of assignment to treatment implied by the permutation matrix

HT

when HT=TRUE, invokes the Horvitz-Thompson (difference-in-totals) estimator. When HT=FALSE, invokes the inverse-probability-weighted regression estimator

Value

An r-length vector of estimated ATEs

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

estate, genouts, genprob, genperms, genperms.custom

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
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))

perms <- genperms(Z,blockvar=block, clustvar=cluster) # all possible permutations
probs <- genprobexact(Z,blockvar=block, clustvar=cluster) # probability of treatment
ate <- estate(y,Z,prob=probs) # estimate the ATE

## Conduct Sharp Null Hypothesis Test of Zero Effect for Each Unit

Ys <- genouts(y,Z,ate=0) # generate potential outcomes under sharp null of no effect
distout <- gendist(Ys,perms, prob=probs) # generate sampling dist. under sharp null
dispdist(distout, ate)  # display characteristics of sampling dist. for inference

## Generate Sampling Distribution Around Estimated ATE

Ys <- genouts(y,Z,ate=ate) ## generate potential outcomes under tau = ATE
distout <- gendist(Ys,perms, prob=probs) # generate sampling dist. under tau = ATE
dispdist(distout, ate)  ## display characteristics of sampling dist. for inference

Example output

$two.tailed.p.value
[1] 0.1666667

$two.tailed.p.value.abs
[1] 0.1944444

$greater.p.value
[1] 0.08333333

$lesser.p.value
[1] 0.9444444

$quantile
     2.5%     97.5% 
-2.055556  2.222222 

$sd
[1] 1.440879

$exp.val
[1] 1.048454e-16

$two.tailed.p.value
[1] 1

$two.tailed.p.value.abs
[1] 0.5

$greater.p.value
[1] 0.5

$lesser.p.value
[1] 0.5833333

$quantile
     2.5%     97.5% 
0.2222222 3.6111111 

$sd
[1] 1.074393

$exp.val
[1] 2

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