# CHI-SQUARE TEST

Here we present a program to compute the chi square test for 3 groups and 7 parameters.

Using material from

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

INPUT

F = [ F1 F2 F3 F4 F5 F6 F7

F8 F9 F10 F11 F12 F13 F14

F15 F16 F17 F18 F19 F20 F21 ]

= [F]

Assuming these are three separate samples and each sample contains 7 parameters

OUTPUT

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

Alternative: at least two of the means are different

``2 → DIM(L6)``
``DIM([F]) → L6``
``L6(1) → S``
``L6(2) → T``
``0 → DIM (L4)``
``S → DIM (L4)``
``0 → A``
``FOR(P,1,S,1)``
``FOR(M,1,T,1)``
``L4(P) + [F](P,M) → L4(P)``
``END``
``A + L4(P) → A``
``END``
``0 → DIM(L5)``
``T → DIM(L5)``
``FOR(M,1,T,1)``
``FOR(P,1,S,1)``
``L5(M) + [F](P,M) → L5(M)``
``END``
``END``
``DIM([F]) → DIM([G])``
``FOR(M,1,T,1)``
``FOR(P,1,S,1)``
``(L4(P) * L5(M))/A) → [G](P,M)``
``END``
``END``
``0 → B``
``FOR(M,1,7,1)``
``FOR(P,1,3,1)``
``B+(([G](P,M)-[F](P,M) )^2)/[G](P,M)) → B``
``END``
``END``
``(S-1)*(T-1) → K``
``K/2 → K``
``“(x^(K-1))*e^(-x/2))/ ((2^K)*(K-1)!)→ Y1``
``fnInt(Y1,x,0,B) → H``
``1-H → Z``
``H*100 → H``
``DISP “required confidence interval to accept null hypothesis”, H``
``DISP “required level of significance to accept null hypothesis”, Z``