Learn R Programming

RI2by2 (version 1.4)

Perm.CI: Permutation test confidence interval for a treatment effect on a binary outcome

Description

Computes permutation-based confidence intervals for the average treatment effect on a binary outcome in an experiment where \(m\) of \(n\) individuals are randomized to treatment by design.

Usage

Perm.CI(data, level, nperm)

Value

tau.hat

estimated average treatment effect

lower

lower bound of confidence interval

upper

upper bound of confidence interval

Arguments

data

observed 2 by 2 table in matrix form where row 1 is the treatment assignment Z=1 and column 1 is the binary outcome Y=1

level

significance level of hypothesis tests, i.e., method yields a 100(1-level)% confidence interval

nperm

number of randomizations to perform for each hypothesis test

Author

Joseph Rigdon jrigdon@wakehealth.edu

Details

The permutation confidence interval results from inverting \(O(n^{4})\) hypothesis tests where \(n\) is the total number of observations in the observed 2 by 2 table. For each hypothesis test, if \(n \choose m\) is less than or equal to nperm, \(n \choose m\) randomizations are performed, but if \(n \choose m\) is greater than nperm, a random sample with replacement of nperm randomizations are performed.

References

Rigdon, J.R. and Hudgens, M.G. (2015). Randomization inference for treatment effects on a binary outcome. Statistics in Medicine, 34(6), 924-935.

Examples

Run this code
 ex = matrix(c(8,2,3,7),2,2,byrow=TRUE)
 Perm.CI(ex,0.05,100)

Run the code above in your browser using DataLab