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\left(\tau\beta\right)_{ij}/\sigma, i=1, \ldots, a, j=1,\ldots, b, where a=b=2a=b=2 and σ\sigma 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\sum_{i=1}^a \left(\tau\beta\right)_{ij} = \sum_{j=1}^b \left(\tau\beta\right)_{ij}=0. We can get (τβ)11=θ\left(\tau\beta\right)_{11}=\theta, (τβ)12=θ\left(\tau\beta\right)_{12}=-\theta, (τβ)21=θ\left(\tau\beta\right)_{21}=-\theta, (τβ)22=θ\left(\tau\beta\right)_{22}=\theta. So tauBetaSigma=θ/σ\theta/\sigma

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,y_{ijk}=\mu+\tau_i + \beta_j + \left(\tau\beta\right)_{ij} + \epsilon_{ijk},

where i=1,,a,j=1,,b,k=1,,ni=1,\ldots, a, j=1,\ldots, b, k=1, \ldots, n, i=1aτi=0\sum_{i=1}^{a}\tau_i = 0, j=1bβj=0\sum_{j=1}^{b}\beta_j = 0, i=1a(τβ)ij=0\sum_{i=1}^{a} \left(\tau\beta\right)_{ij} = 0, j=1b(τβ)ij=0\sum_{j=1}^{b} \left(\tau\beta\right)_{ij} = 0, and ϵijki.i.dN(0,σ2)\epsilon_{ijk}\stackrel{i.i.d}{\sim} N\left(0, \sigma^2\right).

The group means are

μij=μ+τi+βj+(τβ)ij,i=1,a,j=1,,b.\mu_{ij} = \mu+\tau_i + \beta_j + \left(\tau\beta\right)_{ij}, i=1 \ldots, a, j=1,\ldots, b.

Note that μ=i=1aj=1bμij/(ab)\mu = \sum_{i=1}^{a}\sum_{j=1}^b \mu_{ij} / (ab), τi=j=1bμij/bμ\tau_i = \sum_{j=1}^b \mu_{ij}/b - \mu, and βj=i=1aμij/aμ\beta_j = \sum_{i=1}^a \mu_{ij}/a - \mu.

The null hypothesis H0H_0: all (τβ)ij,i=1,,a,j=1,,b\left(\tau\beta\right)_{ij}, i=1, \ldots, a, j=1,\ldots, b are equal to zero. The alternative hypothesis HaH_a: at least one (τβ)ij\left(\tau\beta\right)_{ij} is different from zero.

The F test statistic is

F=MSAB/MSEHaF(a1)(b1),ab(n1),ncp,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=ni=1aj=1b[(τβ)ijσ]2.ncp=n\sum_{i=1}^{a}\sum_{j=1}^{b}\left[\frac{\left(\tau\beta\right)_{ij}}{\sigma}\right]^2.

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

ncp=4n(θσ)2.ncp=4n\left(\frac{\theta}{\sigma}\right)^2.

The power for testing the null hypothesis H0H_0 versus the alternative hypothesis HaH_a is

power=Pr(F>F0Ha),power=Pr\left(F > F_0 | H_a\right),

where the rejection region boundary F0F_0 satisfies:

Pr(F>F0H0)=α/nTests.Pr\left(F > F_0 | H_0\right) = \alpha/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]