powerInteract2by2 {powerMediation} | R Documentation |
Power Calculation for Interaction Effect in 2x2 Two-Way ANOVA Given Effect Sizes
Description
Power calculation for interaction effect in 2x2 two-way ANOVA given effect sizes.
Usage
powerInteract2by2(n, tauBetaSigma, alpha = 0.05, nTests = 1, verbose = FALSE)
Arguments
n |
integer. Number of subjects per group.
|
tauBetaSigma |
Effect sizes (τβ)ij/σ,i=1,…,a,j=1,…,b , where a=b=2 and σ is
the standard deviation of random error. Rows are for factor 1 and columns are for factor 2. Note that ∑i=1a(τβ)ij=∑j=1b(τβ)ij=0 . We can get
(τβ)11=θ ,
(τβ)12=−θ ,
(τβ)21=−θ ,
(τβ)22=θ . So
tauBetaSigma= θ/σ
|
alpha |
family-wise type I error rate.
|
nTests |
integer. For high-throughput omics study,
we perform two-way ANOVA for each of 'nTests' probes.
We use Bonferroni correction to control for family-wise type I error rate.
That is, for each probe, type I error rate would be alpha/nTests .
|
verbose |
logical. Indicating if intermediate results should be printed out.
|
Details
We assume the following model:
yijk=μ+τi+βj+(τβ)ij+ϵijk,
where i=1,…,a,j=1,…,b,k=1,…,n
, ∑i=1aτi=0
,
∑j=1bβj=0
, ∑i=1a(τβ)ij=0
,
∑j=1b(τβ)ij=0
,
and ϵijk∼i.i.dN(0,σ2)
.
The group means are
μij=μ+τi+βj+(τβ)ij,i=1…,a,j=1,…,b.
Note that μ=∑i=1a∑j=1bμij/(ab)
,
τi=∑j=1bμij/b−μ
, and
βj=∑i=1aμij/a−μ
.
The null hypothesis H0
: all (τβ)ij,i=1,…,a,j=1,…,b
are equal to zero.
The alternative hypothesis Ha
: at least one (τβ)ij
is different from zero.
The F test statistic is
F=MSAB/MSE∼HaF(a−1)(b−1),ab(n−1),ncp,
where ncp
is the
non-centrality parameter of the F test statistic:
ncp=n∑i=1a∑j=1b[σ(τβ)ij]2.
For the scenario a=b=2
, we have
(τβ)11=θ
,
(τβ)12=−θ
,
(τβ)21=−θ
,
(τβ)22=θ
.
Hence,
the non-centrality parameter can be simplified to
ncp=4n(σθ)2.
The power for testing the null hypothesis H0
versus
the alternative hypothesis Ha
is
power=Pr(F>F0∣Ha),
where the rejection region boundary F0
satisfies:
Pr(F>F0∣H0)=α/nTests.
Value
A list with 5 elements:
power |
the power of the two-way ANOVA test
|
df1 |
the first degree of freedom of the F test statistic (df1=(a-1)(b-1) )
|
df2 |
the second degree of freedom of the F test statistic (df1=a*b(n-1) )
|
F0 |
the rejection region boundary
|
ncp |
the non-centrality parameter
|
Author(s)
Weiliang Qiu weiliang.qiu@gmail.com
References
Chow SC, Shao J, and Wang H.
Sample size calculations in clinical research. 2nd edition.
Chapman & Hall/CRC. 2008
Montgomery DC.
Design and Analysis of Experiments. 8th edition.
John Wiley & Sons. Inc.
Examples
n = 25
tauBetaSigma = 0.3
# power = 0.8437275
res2 = powerInteract2by2(n = n, tauBetaSigma = tauBetaSigma,
alpha = 0.05, nTests = 1, verbose = TRUE)
[Package
powerMediation version 0.3.4
Index]