# How to identify if relationship between two categorical variables is significant or not?

I have one dependent categorical variable and other many explanatory categorical variables. The number of nominal values for any of these categorical variables may fall in range of 5-100. My objective is to explore the relationship between dependent categorical variable and any one of explanatory variable and to find out if there is any significant relationship.

The tools I can think of are like contingency tables with tests like chi-square etc. Are there any other specific suggestions?

Datasets that I am going to use are large with at least 50,000 datapoints (rows) and I am using spotfire (S+) for my analysis.

• I presume you have considered using multinomial logistic regression (I know you know about it as you have asked other questions on it). Is there a reason why it is not helpful here? eg something to do with there being too many models with combinations of variables, so you are worried about problems of false positives from data mining. – Peter Ellis Mar 21 '12 at 18:57
• This question is complicated by the fact that some of the variables have so many levels. Other than that the range is 5-100, what is the general distribution? Is there any way of re-conceptualising or reshaping the data? With "many" possible explanatory variables including some that have 100 levels, even 50000 datapoints starts looking quite small. – Peter Ellis Mar 21 '12 at 19:01
• Thanks Peter. Your guess is right about reason behind my looking for method other than multinomial logistic regression. In output of multinomial logistic regression, I see all of these categorical variables being converted into many binary variables, one for each value of the categorical variable. So in output I was getting huge list of variables which was difficult to interpret. To your second part, I can bring down range of values between say 5 - 20. Would that help in finding a suitable methodology? If yes, what would be that? – Raghvendra Mar 21 '12 at 19:23

The large number of levels in many of your categorical variables would be one reason your Chi square tests return warnings with expected count <5. With many variables with many levels, even 50,000 data points is not that many.

I would collapse your variables' levels to a more realistic number eg 5-8. Then just perform Chi square tests between the response and the candidate explanatory variables, but with some kind of multiple comparisons correction for the fact that you are performing so many tests simultaneously. How best to do such a multiple comparisons correction is a little complex because your tests are not independent.