Part 2. MM4XL Tools > 2. Analytical Tools > CrossTab > 3. Technicalities > Testing tables for independence (Chi squared)
## CrossTab ### Testing tables for independence (Chi squared) Say, we want to find out whether there is a relationship between clients in the respective class and the language they speak. A **χ**^{2} test can help us answering the question above. This test requires working with categorical values, as from a contingency table, as opposed to the test for proportions discussed above that requires continuous variables. χ^{2} test tells us, at the given confidence level, if the table comes from a random sample or if there is any significant effect affecting columns and rows. In other words it tells us whether the two variables are independent or they are related in some way. *Note:* The Chi squared test is asymptotically very good, yet it might lead to wrong conclusions when some cells hold less than 5 elements. From our example, the χ^{2} test made with 95% confidence, TRUE, answers that there is in fact a dependency between the two variables Language and Client class. Respondents who speak English and Spanish are more frequent in the Class A, while French is more frequent in Class C. The hypotheses CrossTab tests are: Reject if (variables are independent); otherwise, do not reject (variables are related). If χ^{2} is rejected CrossTab prints **FALSE** in the first line of text below the table, together with the confidence level, otherwise in prints **TRUE**. The test statistic is computed as follows: _{} Where: Observed frequency; Expected frequency. *Tip:* Excel makes available =CHIVALUE(x,df) and CHIINV(x,df) for computing Chi square values. |