Number: The number of nuisance parameters considered
alpha
Significance level
alternative
Indicates the alternative hypothesis: must be either "less", "two.sided", or "greater"
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 interval=TRUE
method
Indicates the method for finding tables as or more extreme than the observed table:
must be either "Z-pooled", "Z-unpooled", "Santner and Snell", "Boschloo", "CSM", "CSM modified", or "CSM approximate"
ref.pvalue
Logical: Indicates if p-value should be refined by maximizing the p-value function after the nuisance parameter is selected
simulation
Logical: Indicates if the power calculation is exact or estimated by simulation
nsim
Number of simulations run. Only used if simulation=TRUE
Details
The power calculations are for binomial models. The design must know the fixed sample sizes
in advance. There are (n_1+1) \times (n_2+1) possible tables that could be produced. There are two ways to
calculate the power: simulate the tables under two independent binomial distributions or consider all possible
tables and calculate the exact power. The calculations can be done for any exact.test
computation or using Fisher's exact test.
Value
The function returns the computed power.
Note
The code takes a very long time for the CSM test. Not refining the p-value often yields similar
results and decreases the computation time.
Author(s)
Peter Calhoun
References
Berger, R. (1994) Power comparison of exact unconditional tests for comparing two binomial proportions.
Institute of Statistics Mimeo Series No. 2266
Berger, R. (1996) More powerful tests from confidence interval p values. American Statistician, 50, 314-318
Boschloo, R. D. (1970), Raised Conditional Level of Significance for the 2x2-table
when Testing the Equality of Two Probabilities. Statistica Neerlandica, 24, 1-35
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(Exact)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/Exact/power.exact.test.Rd_%03d_medium.png", width=480, height=480)
> ### Name: power.exact.test
> ### Title: Power calculation for unconditional exact test
> ### Aliases: power.exact.test
> ### Keywords: Power Barnard Boschloo Unconditional Exact
>
> ### ** Examples
>
>
> power.exact.test(0.20,0.80,10,20)
$power
[1] 0.9131096
$alternative
[1] "two.sided"
$method
[1] "Z-pooled"
> power.exact.test(0.20,0.80,10,20,method="Fisher")
$power
[1] 0.87467
$alternative
[1] "two.sided"
$method
[1] "Fisher"
> set.seed(218461)
> power.exact.test(0.20,0.80,10,20,interval=TRUE,method="Boschloo",simulation=TRUE,nsim=100)
$power
[1] 0.91
$alternative
[1] "two.sided"
$method
[1] "Boschloo"
>
>
>
>
>
>
> dev.off()
null device
1
>