invert.ci: Confidence intervals through test inversion

Description Usage Arguments Value Author(s) References Examples

View source: R/invert.ci.R

Description

Experimental code to generate endpoints of Rosenbaum (2002)-style confidence intervals through inversion of a constant effects hypothesis. Only conducts inference with the difference in (weighted) means as the test statistic, no covariate adjustment.

Usage

1
invert.ci(Y, Z, prob, perms, targetp)

Arguments

Y

numeric vector of length N, outcome variable

Z

binary vector (0 or 1) of length N, treatment indicator

prob

numeric vector within the (0,1) interval of length N, probability of treatment assignment, as outputted by genprob() or genprobexact(). When prob=NULL (the default), assumes uniform probability of assignment to treatment equal to the mean of Z

perms

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

targetp

target p-value for the endpoint of the confidence interval

Value

returns endpoint of the confidence interval with the target p-value associated

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.

Rosenbaum, Paul R. 2002. Observational Studies. 2nd ed. New York: Springer.

Examples

1
2
3
4
5
6
7
y <- c(8,6,2,0,3,1,1,1,2,2,0,1,0) 
Z <- c(1,1,0,0,1,1,0,0,1,1,1,1,0)

perms <- genperms(Z) ## all possible permutations of assignment to treatment
probs <- genprobexact(Z) ## assuming complete randomization

c(invert.ci(y,Z,probs,perms,0.025),invert.ci(y,Z,probs,perms,0.975)) ## 95% CI

Example output

[1] -1.059701e-05  4.999930e+00

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