# ANOVA [Two-Factor Factorial Experiment, Fixed Effects Model]

Here we present a program to compute analysis of variance for 2 levels using 3 settings for each and to the confident interval and P-value requirement.

Using material from

Montgomery C. Douglas and Runger C. George, Applied Statistics and Probability for Engineers, Wiley, 2007.

INPUT

H = [ H1 H2 H3 H4 H5

H6 H7 H8 H9 H10

H11 H12 H13 H14 H15 ]

= [H]

I = [ I1 I2 I3 I4 I5

I6 I7 I8 I9 I10

I11 I12 I13 I14 I15 ]

= [I]

J = [ J1 J2 J3 J4 J5

J6 J7 J8 J9 J10

J11 J12 J13 J14 J15 ]

= [J]

Assuming [H], [I], and [J] are three settings where each setting contains three levels and each level contains 5 replications. Levels and settings could represent two factors.

Null hypothesis: there is no difference between the means of the different levels

Alternative: at least two of the means are different

OUTPUT

Level of significance, confidence interval

Hypothesis testing

``2 → DIM(L6)``
``DIM([E]) → L6``
``L6(1) → S``
``L6(2) → T``
``{1,1} → DIM([G])``
``0 → [G](1,1)``
``{S,S} → DIM([G])``
``For(P,1,S,1)``
``For(M,1,T,1)``
``[H](P,M) + [G](P,1) → [G](P,1)``
``[I](P,M) + [G](P,2) → [G](P,2)``
``[J](P,M) + [G](P,3) → [G](P,3)``
``END``
``END``
``FOR(P,1,S,1)``
``FOR(M,1,S,1)``
``[G](P,M) / T → [G](P,M)``
``END``
``END``
``0 → DIM(L4)``
``0 → DIM(L5)``
``S → DIM(L4)``
``S → DIM(L5)``
``FOR(P,1,S,1)``
``FOR(M,1,S,1)``
``L4(P) +[G](P,M) → L4(P)``
``L5(M) +[G](P,M) → L5(M)``
``END``
``END``
``L4/S → L4``
``L5/S → L5``
``0 → Z``
``FOR(M,1,S,1)``
``Z+L5(M) → Z``
``END``
``Z/S → Z``
``0 → A``
``0 → B``
``FOR(P,1,S,1)``
``A+(L4(P)-Z)^2 → A``
``B+(L5(P)-Z)^2 → B``
``END``
``A*S*T → A``
``B*S*T → B``
``FOR(P,1,S,1)``
``FOR(M,1,S,1)``
``([G](P,M)-L4(P)-L5(M)+Z)^2→[G](P,M)``
``END``
``END``
``0 → C``
``FOR(M,1,S,1)``
``FOR(P,1,S,1)``
``C + [G](M,P) → C``
``END``
``END``
``T*C → C``
``AUGMENT([H],[I]) → [E]``
``AUGMENT([J],[E]) → [E]``
``S*T → R``
``FOR(M,1,S,1)``
``FOR(P,1,R,1)``
``([E](M,P)-Z)^2 → [E](M,P)``
``END``
``END``
``0 → D``
``FOR(M,1,S,1)``
``FOR(P,1,R,1)``
``D+[E](M,P) → D``
``END``
``END``
``D-A-B-C → E``
``(S-1) → X``
``(S-1) → Y``
``(S-1) * (S-1) → V``
``S * S * (T-1) → W``
``DISP “USING F DISTRIBUTION”``
``((X + W)/2-1)! * ((X/W)^(X/2))→ K``
``K / ((X/2-1)! * (W/2-1)!) → K``
``(X/2)-1 → M``
``(X/W) → R``
``(X+W)/2 → Q``
``“K * (X^M) / ((R*x+1)^Q)→ Y1``
``((Y+W)/2-1)! * ((Y/W)^(Y/2))→ K``
``K / ((Y/2-1)! * (W/2-1)!) → K``
``(Y/2)-1 → M``
``(Y/W) → R``
``(Y+W)/2 → Q``
``“K * (X^M) / ((R*x+1)^Q)→ Y2``
``((V+W)/2-1)! * ((V/W)^(V/2))→ K``
``K / ((V/2-1)! * (W/2-1)!) → K``
``(V/2)-1 → M``
``(V/W) → R``
``(V+W)/2 → Q``
``“K * (X^M) / ((R*x+1)^Q)→ Y3``
``A/X → M``
``B/Y → N``
``C/V → P``
``E/W → R``
``M/R → L``
``N/R → J``
``P/R → K``
``fnInt(Y1,x,0,L) → H``
``1-H → Z``
``H*100 → H``
``DISP “for each setting or sample, required confidence interval to accept null hypothesis”, H``
``DISP “for each setting or sample, required level of significance to accept null hypothesis”, Z``
``fnInt(Y2,x,0,J) → H``
``1-H → Z``
``H*100 → H``
``DISP “for each level or column, required confidence interval to accept null hypothesis”, H``
``DISP “for each level or column, required level of significance to accept null hypothesis”, Z``
``fnInt(Y3,x,0,K) → H``
``1-H → Z``
``H*100 → H``
``DISP “for interaction between settings or factors, required confidence interval to accept null hypothesis”, H``
``DISP “for interaction between settings or factors, required level of significance to accept null hypothesis”, Z``