I want to test if two observations of nominal data accord to the same distribution. I am using the chi squared statistics to perform a chi squared homogeneity test and normalize the result with Cramer's $\phi $$\phi$.
Unfortunately, all the examples for performing a chi squared homogeneity test I could find (e.g. here) perform the test with two one-dimensional observations. The example after the link above, for example, compares boys and girls dependent on their viewing preferences. This makes two observations in the form $[x_0, \ldots, x_n] $$[x_0, \ldots, x_n]$. However, I want to test observations in the form $[[x_0, \ldots, x_n], \ldots, [z_0, ..., z_m]] $$[[x_0, \ldots, x_n], \ldots, [z_0, ..., z_m]]$. I don't know, if "multidimensional" is the right term in this context. I figured it might be.
How do you calculate $\chi^2 $$\chi^2$ for determining the homogeneity of multidimensional observations? Please note that I know how to calculate $\chi^2 $$\chi^2$ on a multi-row contingency table. Instead I want to know how to perform a for the homogeneity of two contingency tables.
The sum of the squared differences, divided by the expected value, yields the $\chi^2 $$\chi^2$ value. Note, however, that the expected tables are not just the expected values from each individual table (quick proof for the first cell of table 1: $\frac{146 \cdot 165}{263} = 91.60 $$\frac{146 \cdot 165}{263} = 91.60$). Instead their calculation seems to be somehow dependantdependent on each other.