Rejection Region for 2x2 Tables
Determines the rejection region for known sample sizes and significance level.
exact.reject.region(n1, n2, alternative = c("two.sided", "less", "greater"), alpha = 0.05, npNumbers = 100, np.interval = FALSE, beta = 0.001, method = c("z-pooled", "z-unpooled", "boschloo", "santner and snell", "csm", "csm approximate", "fisher", "chisq", "yates chisq"), tsmethod = c("square", "central"), ref.pvalue = TRUE, delta = 0, convexity = TRUE)
n1 |
The sample size in first group |
n2 |
The sample size in second group |
alternative |
Indicates the alternative hypothesis: must be either "two.sided", "less", or "greater" |
alpha |
Significance level |
npNumbers |
Number: The number of nuisance parameters considered |
np.interval |
Logical: Indicates if a confidence interval on the nuisance parameter should be computed |
beta |
Number: Confidence level for constructing the interval of nuisance parameters considered. Only used if np.interval=TRUE |
method |
Indicates the method for finding the more extreme tables: must be either "Z-pooled", "Z-unpooled", "Santner and Snell", "Boschloo", "CSM", "CSM approximate", "Fisher", "Chisq", or "Yates Chisq" |
tsmethod |
Indicates two-sided method: must be either "square" or "central" |
ref.pvalue |
Logical: Indicates if p-value should be refined by maximizing the p-value function after the nuisance parameter is selected |
delta |
Number: null hypothesis of the difference in proportion |
convexity |
Logical: assumes convexity for interval approach. Only used if np.interval=TRUE |
The rejection region are calculated for binomial models. The design must know the fixed sample sizes in advance. Rejection region can be determined for any exact.test
computation, Fisher's exact test, or chi-square test (Yates' or Pearson's; note: these are not exact tests). All tests attain the convexity property which greatly speeds up computation time (see Chan for definition). However, in very rare cases, using the nuisance parameter interval approach does not attain the convexity property, so it is possible using convexity=TRUE
could yield an inaccurate power calculation with this method. This is extremely unlikely though, so default is to assume convexity and speed up computation time. For details regarding parameters, see exact.test
.
A matrix of the rejection region. The columns represent the number of successes in first group, rows represent the number of successess in second group, and cells represent whether the test is rejected (1) or failed to be rejected (0). This matrix represents all possible 2x2 tables.
Pearson's and Yates' chi-square tests are not exact test, so the function name may be a misnomer. However, these options were added to compute the rejection region efficiently when using asymptotic tests.
Peter Calhoun
Barnard, G.A. (1947) Significance tests for 2x2 tables. Biometrika, 34, 123-138
Chan, I. (2003), Proving non-inferiority or equivalence of two treatments with dichotomous endpoints using exact methods, Statistical Methods in Medical Research, 12, 37–58
exact.reject.region(n1=10, n2=20, alternative="two.sided", method="Z-pooled") exact.reject.region(n1=10, n2=20, alternative="less", method="CSM", delta=0.10)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.