Let Xij‘s be Random Sample from N(μij,σ2). The μij=μ+αi+βj can be decomposed as sum of means
(global mean +i-th level effect of factor A+j-th level effect of factor B). In this setup, we assume that i=1∑aαi=j=1∑bβj=0
We want to test H0:β1,β2=⋯=βb.
F=i=1∑aj=1∑b(Xij−Xi.−X.j+X..)2/(a−1)(b−1)i=1∑aj=1∑b(X.j−X..)2/(b−1)∼F((b−1),(a−1)(b−1))
where i=1∑aj=1∑b(X.j−X..)2∼χ2(b−1), and i=1∑aj=1∑b(Xij−Xi.−X.j+X..)2∼χ2((a−1)(b−1))
Under H1, the F follows Noncentral F-DistributionF′=i=1∑aj=1∑b(Xij−Xi.−X.j+X..)2/(a−1)(b−1)aj=1∑b(X.j−X..)2/(b−1)∼F((b−1),(a−1)(b−1),a∑j=1bβj2/σ2)
where σ21aj=1∑b(X.j−X..)2∼χ2(b−1,aj=1∑bβj2/σ2)
Therefore, the power of the test is P(F′>Fα)
Two-way ANOVA With Equal Replications
1
2
…
b
1
X111,…,X11n
X121,…,X12n
…
X1b1,…,X1bn
2
X211,…,X21n
X221,…,X22n
…
X2b1,…,X1bn
⋮
⋮
⋮
⋱
⋮
a
Xa11,…,Xa1n
Xa21,…,Xa2n
…
Xab1,…,Xabn
Let Xijk‘s be Random Sample from N(μij,σ2). The μijk=μ+αi+βj+γij can be decomposed as sum of means
(global mean + i-th level effect of factor A + j-th level effect of factor B + interaction effect of i-th level of factor A and the j-th level of factor B ). In this setup, we assume that i=1∑aαi=j=1∑bβj=i=1∑aγij=j=1∑bγij=0
We want to test H0:γij=0,∀i,j.
F=i=1∑aj=1∑bk=1∑n(Xijk−Xij.)2/(N−ab)i=1∑aj=1∑bk=1∑n(Xij.−Xi..−X.j.+X...)2/(a−1)(b−1)∼F((a−1)(b−1),N−ab)
where N=i=1∑aj=1∑bn=abn, i=1∑aj=1∑bk=1∑n(Xij.−Xi..−X.j.+X...)2∼χ2((a−1)(b−1)), and i=1∑aj=1∑bk=1∑n(Xijk−Xij.)2∼χ2((N−ab))
Under H1, the F follows Noncentral F-DistributionF′=i=1∑aj=1∑bk=1∑n(Xijk−Xij.)2/(N−ab)ni=1∑aj=1∑b(Xij.−Xi..−X.j.+X...)2/(a−1)(b−1)∼F((a−1)(b−1),(N−ab),ni=1∑aj=1∑bγij2/σ2)
where ni=1∑aj=1∑b(Xij.−Xi..−X.j.+X...)2∼χ2((a−1)(b−1),ni=1∑aj=1∑bγij2/σ2)
Therefore, the power of the test is P(F′>Fα)
If H0:γij=0,∀i,j is not rejected, then we continue to test H0:α1=α2=⋯=αa=0 or H0:β1=β2=⋯=βb=0
Two-way ANOVA with a Regression Model
Y=β0+i=1∑a−1αiDi+j=1∑b−1βjEj+i=1∑a−1j=1∑b−1γijDiEj+ϵ
where Di and Ej are dummy variables representing categories of the two factors, a is the number of categories for the first factor, and b is the number of categories for the second factor
For a two-way ANOVA with factors A and B, we have three null hypotheses to test:
H0A:α1=α2=αa−1=0 i.e. there is no treatment effect of factor A
H0B:β1=β2=βb−1=0 i.e. there is no treatment effect of factor B
H0AB:γij=0,∀i,j i.e. there is no interaction effect between factor A and B
They can be tested with the Deviance.
If σ2 is known, the test statistic for H0A is defined as
ΔDA=D0−D1=σ21(bn1i=1∑ayi..2−N1Y...2)∼χ2(a−1)
And reject the H0A if ΔDA>χ2(a−1)
If σ2 is unknown, the test statistic for H0A is defined as
FA=a−1D0−D1/N−abD1∼F(a−1,N−ab)
And reject the H0A if FA>F(a−1,N−ab)
If σ2 is known, the test statistic for H0B is defined as
ΔDB=D0−D1=σ21(an1j=1∑by.j.2−N1Y...2)∼χ2(b−1)
And reject the H0B if ΔDB>χ2(b−1)
If σ2 is unknown, the test statistic for H0B is defined as
FB=b−1D0−D1/N−abD1∼F(b−1,N−ab)
And reject the H0B if FB>F(b−1,N−ab)
If σ2 is known, the test statistic for H0AB is defined as
ΔDAB=D0−D1=σ21(n1i=1∑aj=1∑byij.2−bn1i=1∑aYi..2−an1j=1∑bY.j.2+N1Y...2)∼χ2((a−1)(b−1))
And reject the H0AB if ΔDAB>χ2((a−1)(b−1))
If σ2 is unknown, the test statistic for H0AB is defined as
FAB=(a−1)(b−1)D0−D1/N−abD1∼F((a−1)(b−1),N−ab)
And reject the H0AB if FAB>F((a−1)(b−1),N−ab)