How to execute χ-square test with cross tabulation?

You can execute \chi^2 test with cross tabulation by such formula as below. In each cells, subtract expected value (E) from observed value (O), square the subtraction, divide the squared by expected value and add them all.

\displaystyle\chi^2(df)=\sum\frac{(O-E)^2}{E}

df: degree of freedom

\chi^2 statistics follows \chi^2 distribution. When degree of freedom is 1, \chi^2 statistics is 3.841 if probability is smaller than 0.05 in one sided test, \chi^2 is 6.635 if p < 0.01, [latex]\chi^2[/latex] is 10.828 if p < 0.001, respectively. In two-tailed test, [latex]\chi^2[/latex] is 5.024 if p < 0.05, [latex]\chi^2[/latex] is 7.879 if p < 0.01, respectively.

  TRUE FALSE Marginal total
POSITIVE a b a + b
NEGATIVE c d c + d
Marginal total a + c b + d N 
\displaystyle \begin{array}{rcl}\chi^2&=&(ad-bc)^2\times\frac{N}{(a+b)(c+d)(a+c)(b+d)}\vspace{0.2in}\\\chi^2(Yates)&=&\left(|ad-bc|-\frac{1}{2}\right)^2\times\frac{N}{(a+b)(c+d)(a+c)(b+d)}\end{array}