Chi Square Test for Independence of Attribute
The chi square test can be used to find out whether two or more attributes are associated or not. This test helps in finding the association or independence of two or more attributes. In order to test the independence of two attributes you should take the null hypothesis that the two attributes are independent. The second step under null hypothesis is to compute the expected frequencies for each cell of contingency table. In case of contingency table the expected frequency for ( A_{1}, B_{1}) will be calculated as:
E ( A_{1}, B_{1}) = (A_{1}) (B_{1}) / N
After computing expected frequencies you can calculate the value of chi square . the calculated value of chi square will be then compared with table value at certain level of significance ( usually at 5% for ( r- 1) ( c-1) degree of freedom. If the calculated value is lower than table value then you will accept the null hypothesis that two attributes are independent. In case calculated value is greater than the table value then the null hypothesis will be rejected and you will conclude that two attributes are associated.