powerInteract2by2: Power Calculation for Interaction Effect in 2x2 Two-Way ANOVA...

Description Usage Arguments Details Value Author(s) References Examples

View source: R/powerInteract2by2.R

Description

Power calculation for interaction effect in 2x2 two-way ANOVA given effect sizes.

Usage

1
powerInteract2by2(n, tauBetaSigma, alpha = 0.05, nTests = 1, verbose = FALSE)

Arguments

n

integer. Number of subjects per group.

tauBetaSigma

Effect sizes ≤ft(τβ\right)_{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=1}^a ≤ft(τβ\right)_{ij} = ∑_{j=1}^b ≤ft(τβ\right)_{ij}=0. We can get ≤ft(τβ\right)_{11}=θ, ≤ft(τβ\right)_{12}=-θ, ≤ft(τβ\right)_{21}=-θ, ≤ft(τβ\right)_{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:

y_{ijk}=μ+τ_i + β_j + ≤ft(τβ\right)_{ij} + ε_{ijk},

where i=1,…, a, j=1,…, b, k=1, …, n, ∑_{i=1}^{a}τ_i = 0, ∑_{j=1}^{b}β_j = 0, ∑_{i=1}^{a} ≤ft(τβ\right)_{ij} = 0, ∑_{j=1}^{b} ≤ft(τβ\right)_{ij} = 0, and ε_{ijk}\stackrel{i.i.d}{\sim} N≤ft(0, σ^2\right).

The group means are

μ_{ij} = μ+τ_i + β_j + ≤ft(τβ\right)_{ij}, i=1 …, a, j=1,…, b.

Note that μ = ∑_{i=1}^{a}∑_{j=1}^b μ_{ij} / (ab), τ_i = ∑_{j=1}^b μ_{ij}/b - μ, and β_j = ∑_{i=1}^a μ_{ij}/a - μ.

The null hypothesis H_0: all ≤ft(τβ\right)_{ij}, i=1, …, a, j=1,…, b are equal to zero. The alternative hypothesis H_a: at least one ≤ft(τβ\right)_{ij} is different from zero.

The F test statistic is

F=MS_{AB}/MS_{E}\stackrel{H_a}{\sim} F_{(a-1)(b-1), ab(n - 1), ncp},

where ncp is the non-centrality parameter of the F test statistic:

ncp=n∑_{i=1}^{a}∑_{j=1}^{b}≤ft[\frac{≤ft(τβ\right)_{ij}}{σ}\right]^2.

For the scenario a=b=2, we have ≤ft(τβ\right)_{11}=θ, ≤ft(τβ\right)_{12}=-θ, ≤ft(τβ\right)_{21}=-θ, ≤ft(τβ\right)_{22}=θ. Hence, the non-centrality parameter can be simplified to

ncp=4n≤ft(\frac{θ}{σ}\right)^2.

The power for testing the null hypothesis H_0 versus the alternative hypothesis H_a is

power=Pr≤ft(F > F_0 | H_a\right),

where the rejection region boundary F_0 satisfies:

Pr≤ft(F > F_0 | H_0\right) = α/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

1
2
3
4
5
6
n = 25
tauBetaSigma = 0.3

# power = 0.8437275
res2 = powerInteract2by2(n = n, tauBetaSigma = tauBetaSigma, 
    alpha = 0.05, nTests = 1, verbose = TRUE)

powerMediation documentation built on March 24, 2021, 1:06 a.m.