exact.reject.region: Rejection Region for 2x2 Tables with Independent Samples

View source: R/exact.reject.region.R

exact.reject.regionR Documentation

Rejection Region for 2x2 Tables with Independent Samples


Determines the rejection region for comparing two independent proportions.


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", "fisher", "pearson chisq", "yates chisq"),
    tsmethod = c("square", "central"), delta = 0, convexity = TRUE,
    useStoredCSM = TRUE)



The sample size in first group


The sample size in second group


Indicates the alternative hypothesis: must be either "two.sided", "less", or "greater"


Significance level


Number: The number of nuisance parameters considered


Logical: Indicates if a confidence interval on the nuisance parameter should be computed


Number: Confidence level for constructing the interval of nuisance parameters considered. Only used if np.interval=TRUE


Indicates the method for finding the more extreme tables: must be either "Z-pooled", "Z-unpooled", "Santner and Snell", "Boschloo", "CSM", "Fisher", "Pearson Chisq", or "Yates Chisq"


Indicates two-sided method: must be either "square" or "central"


Number: null hypothesis of the difference in proportion


Logical: assumes convexity for interval approach. Only used if np.interval=TRUE


Logical: uses stored CSM ordering matrix. Only used if method="csm"


The rejection region is calculated for binomial models with independent samples. The design must know the fixed sample sizes in advance. Rejection region can be determined for any unconditional exact test in exact.test, Fisher's exact test, or chi-square test (Yates' or Pearson's; note: these are not exact tests). 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 tests, so the function name may be a misnomer. These tests may have inflated type 1 error rates. 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

See Also



## Not run: 
# Ensure that the ExactData R package is available before running the CSM test.
if (requireNamespace("ExactData", quietly = TRUE)) {
exact.reject.region(n1=10, n2=20, alternative="two.sided", method="CSM")

## End(Not run)

exact.reject.region(n1=10, n2=20, alternative="less", method="Z-pooled", delta=0.10)

Exact documentation built on Sept. 26, 2022, 1:05 a.m.