An unconditional exact test for the two-sample binomial problem when it is expected that theta1 (probability of an event in group 1) will be close to 1. Used for test versus control when all controls are expected to fail.
borrTest(x1, n1, x2, n2, tuningParm = 0.025,
parmtype = c("ratio", "difference", "oddsratio"),
nullparm = NULL, alternative = c("less", "greater", "two.sided"),
conf.int = TRUE, conf.level = 0.975,
controlUC = ucControl(), controlborr = borrControl(), ...)borrPvals(n1,n2, tuningParm=0.025,
parmtype = c("ratio", "difference","oddsratio"),
nullparm = NULL, alternative = c("less", "greater","two.sided"),
conf.int = TRUE, conf.level = 0.975,
controlUC=ucControl(), controlborr=borrControl(),...)
borrOrdering(n1,n2,tuningParm = .025,
controlborr=borrControl())
powerBorr(n1,n2,p1,p2,alpha=0.025,...)
The function borrPvals
returns a (n1+1) by (n2+1) matrix of p-values for all possible x1 and x2 values. The function borrOrdering
returns a matrix with the rank of all possible x1 and x2 values. The function borrTest
returns a list of class htest
with elements:
proportion in sample 1
proportion in sample 2
p-value from test
confidence interval on parameter given by parmtype
MLE estimate of parameter given by parmtype
null hypothesis value of parameter given by parmtype
alternative hypothesis
description of test
description of data
number of events in group 1
sample size in group 1
number of events in group 2
sample size in group 2
tuning parameter, default is 0.025 and designs BORR tests with maximum power for one-sided 0.025 tests
parameter type, either 'ratio' for theta2/theta1, 'difference' for theta2-theta1, or 'oddsratio' for theta2*(1-theta1)/(theta1*(1-theta2)).
null parameter value, default=NULL gives parameter value for theta1=theta2 (e.g., 1 for 'ratio' or 0 for 'difference' ).
alternative hypothesis, BORR tests are designed for alternative='less' (see Note for other alternatives)
logical, should confidence interval be calculated?
confidence level, default is 0.975 (see note)
a list of control parameters to define algorithms in the call to uncondExact2x2
, see ucControl
a list of control parameters to define algorithms, see borrControl
probability of an event in group 1
probability of an event in group 2
alpha-level for rejecting, reject when p-value $$latex$$ alpha
extra arguments passed (only used for powerBorr
, passes arguments to the borrPvals
function)
Martha Nason, Erin Gabriel, Michael P. Fay
The boundary-optimized rejection region test is designed to test the one-sided alternative that theta2 < theta1, where X1 is binomial(n1,theta1), and X2 is binomial(n2,theta2). The test is designed to be optimal when theta1 is very close to 1. For example, in a vaccine malaria challenge study where we expect all n1 individuals that got the control vaccine to have the event (get malaria when challenged with malaria). For details see Gabriel et al (2018).
The function borrTest
tests the results of one study, and returns
an htest
object. The function borrPvals
calculates the p-values for every possible result of a study. The function borrOrdering
orders every possible result of the study.
See borrOrderingInternal
for calculation details. The function powerBorr
calculates the power
where p-values are calculated by borrPvals
and rejection is when $$latex$$ alpha.
Gabriel, EE, Nason, M, Fay, MP, and Follmann, DA. (2018). A boundary-optimized rejection region test for the two-sample binomial problem. Statistics in Medicine. 37(7): 1047-1058 (DOI: 10.1002/sim.7579).
Gabriel, EE, Nason, M, Fay, MP, and Follmann, DA. (2018). Reply to letter from Martin Andres. Statistics in Medicine 37(14): 2303-2306.
Martin Andres, Antonio. (2018). Letter to the editor about Gabriel et al. Statistics in Medicine 37(14) 2301-2302.
if (FALSE) borrTest(4,4,1,4)
# Note Figure 2 in Gabriel et al is incorrect. The correct value
# is in the response letter, and given by
borrOrdering(4,4,tuningParm=0.025)$rankMat
Run the code above in your browser using DataLab