# Does the sign of the adjusted residuals matter in a crosstable?

In a cross table, if the adjusted residual value for a cell is less than -1.96 or greater than 1.96 then we could say that this cell is determinant in the dependency (suppose pearson is 0.03). However, is this sign really important? I mean, if I get -2.5 can I say that the variables are negatively correlated? I'm creating a cross table with two variables: cluster membership (generated by kmeans) and a few company characteristics. So, If I get this -2.5 in a cell (cluster 3 x industrial companies), could I say that cluster 3 is "poor" of industrial companies?

Thank you.

• Since your attributes are binary, I would be careful with the term correlation. It's more of a co-occurence thing. Try rewriting the correlation formula into a count-based formula. – Has QUIT--Anony-Mousse Oct 19 '12 at 6:34

It's hard to tell what you're asking here, but the residuals in a crosstab indicate whether the observed value is greater or smaller than the expected value.

If you get -2.5 you can conclude something about the number of companies in cluster 3 and whatever column had that cell in it. But what is the other variable? If it is "type of company" (e.g. industrial, service,.... etc) then it would mean cluster 3 had fewer than expected industrial companies.

One note: saying categorical variables are "negatively correlated" makes no sense.

• Thank you, @PeterFlom. The other variable would be type of company(Services, Industrial, Commercial). – neilsoncarlos Oct 18 '12 at 20:50
• You're welcome. If my answer is what you need, you can accept it by clicking the check mark. – Peter Flom Oct 18 '12 at 20:52
• Sorry, I just edited the post. You asked me about the other variable. Thanks again – neilsoncarlos Oct 18 '12 at 20:56

The null hypothesis for a $\chi^2$ analysis of a contingency table is that the rows and columns are independent of each other. Under this null model, the expected count is: $$\hat E_{ij}=\left(\frac{\sum_j n_{ij}}{N}\right)\left(\frac{\sum_i n_{ij}}{N}\right)N$$ In English: The row sum divided by the total $N$ is the probability of finding an observation in that row; the column sum over the total is the probability of finding an observation in that column; and if the rows and columns are independent, the probability of finding an observation in that cell is just the product of the marginal probabilities, and the expected count for that cell is simply that proportion of the total $N$.

What seems to be less well-known is that there can be residuals computed when your data are compared to the null model. For example, the Pearson residual for a cell in a contingency table is: $$r_{ij}=\frac{O_{ij}-\hat{E}_{ij}}{\sqrt{\hat{E}_{ij}}}$$ I gather these are the residuals you are referring to.

These residuals are useful in visualizing contingency table data. For example, they are often used to 'shade' the boxes in a mosaic plot to make it immediately apparent which cells are out of line with expectations, in which direction, and by how much. (You can see an example of this in the mosaic [2nd] plot I posted in my recent question on visualizing contingency table data; note the legend explaining the colors on the side of the plot.)

Having covered these topics, we can answer your question easily: The sign indicates whether the number of observations with those particular characteristics (i.e., row and column classifications) is 'too many' (positive) or 'too few' (negative) relative to what would have been expected under the null model. The larger the residual is, the further that cell count diverges from what would have been expected under the null model. There is no evaluative component to this; positive residuals aren't 'better' than negative residuals. Finally, I agree with @PeterFlom that it makes no sense to say that categorical variables are "negatively correlated".