Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

exact.reject.region

Rejection Region for 2x2 Tables


Description

Determines the rejection region for known sample sizes and significance level.

Usage

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)

Arguments

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

Details

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.

Value

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.

Note

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.

Author(s)

Peter Calhoun

References

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

Examples

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)

Exact

Unconditional Exact Test

v2.1
GPL-2
Authors
Peter Calhoun [aut, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.