Title: | Randomization Inference for Treatment Effects on a Binary Outcome |
---|---|
Description: | Computes attributable effects based confidence interval, permutation test confidence interval, or asymptotic confidence interval for the average treatment effect on a binary outcome. Methods outlined in further detail in Rigdon and Hudgens (2015) <doi:10.1002/sim.6384>. |
Authors: | Joseph Rigdon <[email protected]> |
Maintainer: | Joseph Rigdon <[email protected]> |
License: | GPL (>= 3) |
Version: | 1.4 |
Built: | 2025-03-06 03:32:47 UTC |
Source: | https://github.com/cran/RI2by2 |
Computes the attributable effects based confidence interval for the
average treatment effect on a binary outcome in an experiment where
of
individuals are randomized to treatment by design.
AE.CI(data, level)
AE.CI(data, level)
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- |
The attributable effects based confidence interval from inverting hypothesis tests.
tau.hat |
estimated average treatment effect |
lower |
lower bound of confidence interval |
upper |
upper bound of confidence interval |
Joseph Rigdon [email protected]
Rigdon, J.R. and Hudgens, M.G. (2015). Randomization inference for treatment effects on a binary outcome. Statistics in Medicine, 34(6), 924-935.
ex = matrix(c(8,2,3,7),2,2,byrow=TRUE) AE.CI(ex,0.05)
ex = matrix(c(8,2,3,7),2,2,byrow=TRUE) AE.CI(ex,0.05)
Computes permutation-based confidence intervals for the
average treatment effect on a binary outcome in an experiment where
of
individuals are randomized to treatment by design.
Perm.CI(data, level, nperm)
Perm.CI(data, level, nperm)
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- |
nperm |
number of randomizations to perform for each hypothesis test |
The permutation confidence interval results from inverting
hypothesis tests where
is the total number of
observations in the observed 2 by 2 table. For each hypothesis test,
if
is less than or equal to
nperm
,
randomizations are performed, but if
is greater than
nperm
, a random sample with replacement of nperm
randomizations
are performed.
tau.hat |
estimated average treatment effect |
lower |
lower bound of confidence interval |
upper |
upper bound of confidence interval |
Joseph Rigdon [email protected]
Rigdon, J.R. and Hudgens, M.G. (2015). Randomization inference for treatment effects on a binary outcome. Statistics in Medicine, 34(6), 924-935.
ex = matrix(c(8,2,3,7),2,2,byrow=TRUE) Perm.CI(ex,0.05,100)
ex = matrix(c(8,2,3,7),2,2,byrow=TRUE) Perm.CI(ex,0.05,100)
Computes permutation-based confidence intervals for the
average treatment effect on a binary outcome in an experiment where
of
individuals are randomized to treatment by design.
This function is based on the modified approach (RLH) in
Rigdon, Loh and Hudgens (forthcoming).
The Chiba (2015) and Blaker (2000) intervals are also returned.
There is an additional option of specifying the maximum number of
hypothesis tests to be carried out.
Perm.CI.RLH(data, level, verbose=FALSE, total_tests=NA)
Perm.CI.RLH(data, level, verbose=FALSE, total_tests=NA)
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- |
verbose |
If |
total_tests |
maximum number of hypotheses to be tested in total,
with a minimum of two for each possible value of
|
A list with the following items:
Chiba |
Chiba confidence interval |
RLH |
RLH confidence interval |
Blaker |
Blaker confidence interval |
tau.hat |
estimated average treatment effect |
p_values |
if |
Wen Wei Loh [email protected]
Rigdon, J.R. and Hudgens, M.G. (2015). Randomization inference for treatment effects on a binary outcome. Statistics in Medicine, 34(6), 924-935.
Chiba, Y. (2015). Exact tests for the weak causal null hypothesis on a binary outcome in randomized trials. Journal of Biometrics & Biostatistics, 6(244).
Chiba, Y. (2016). A note on exact confidence interval for causal effects on a binary outcome in randomized trials. Statistics in Medicine, 35(10), 1739-1741.
Blaker, H. (2000). Confidence curves and improved exact confidence intervals for discrete distributions. Canadian Journal of Statistics, 28(4), 783-798.
Rigdon, J.R., Loh W.W. and Hudgens, M.G. (forthcoming). Response to comment on "Randomization inference for treatment effects on a binary outcome."
ex = matrix(c(11,1,7,21),2,2,byrow=TRUE) Perm.CI.RLH(ex,0.05) ex = matrix(c(7,5,1,27),2,2,byrow=TRUE) Perm.CI.RLH(ex,0.05) Perm.CI.RLH(ex,0.05, verbose=TRUE) ex = matrix(c(33,15,11,37),2,2,byrow=TRUE) Perm.CI.RLH(ex,0.05, total_tests=1000) Perm.CI.RLH(ex,0.05)
ex = matrix(c(11,1,7,21),2,2,byrow=TRUE) Perm.CI.RLH(ex,0.05) ex = matrix(c(7,5,1,27),2,2,byrow=TRUE) Perm.CI.RLH(ex,0.05) Perm.CI.RLH(ex,0.05, verbose=TRUE) ex = matrix(c(33,15,11,37),2,2,byrow=TRUE) Perm.CI.RLH(ex,0.05, total_tests=1000) Perm.CI.RLH(ex,0.05)
Computes the Robins (1988) confidence interval for the
average treatment effect on a binary outcome in an experiment where
of
individuals are randomized to treatment by design.
Robins.CI(data, level)
Robins.CI(data, level)
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- |
The Robins (1988) confidence interval is similar in form to the well known Wald confidence interval for a difference in proportions, but is guaranteed to have smaller width.
tau.hat |
estimated average treatment effect |
lower |
lower bound of confidence interval |
upper |
upper bound of confidence interval |
Joseph Rigdon [email protected]
Robins, J.M. (1988). Confidence intervals for causal parameters. Statistics in Medicine, 7(7), 773-785.
#Example 1 from Robins (1988) ex = matrix(c(40,60,15,85),2,2,byrow=TRUE) Robins.CI(ex,0.05)
#Example 1 from Robins (1988) ex = matrix(c(40,60,15,85),2,2,byrow=TRUE) Robins.CI(ex,0.05)