compare magnitude of association between pairs of discrete variables? say I have discrete(nominal) variables Y, X1 and X2. X1 and X2 have different number of levels. I want to assess whether Y is associated more with X1 or X2.
I understand that I could use chi-square test or G-square test to test whether Y is associated with X1 and X2 respectively. But I don't know how to compare the magnitude of the association. I thought about using the Chi-square or the G-square value, but it seems to me that if X1 and X2 have different number of levels, the Chi-square or G-square is not directly comparable.
If my variables were continuous I could probably compare pearson correlation coefficients for magnitude of linear association. Is there a corresponding metric in the discrete case?    
 A: You could use Goodman and Kruskal's Tau B, first described in section 9 of their article, Measures of Association for Cross Classifications, published in the Journal of the American Statistical Association, Vol. 49, No. 268 (Dec., 1954) on pages 759-60.
It's the proportional reduction in errors you would expect to make assigning cases to your response category by guessing if you know the explanatory category of each case versus not knowing.  Thus it is between zero (no reduction in error, meaning no predictive benefit) and one (complete predictive benefit).  Because it's always between zero and one, it will be convenient for you to compare the association of your Y with X1 to that of Y with X2.
This Tau-B (not to be confused with Kendall's) is also explained more clearly in Social Statistics, Revised Second Edition, by Blalock, section 15.4 on pages 307-310.
In their article, Goodman and Kruskal describe other similar statistics you might want to consider, in particular their Lambda (section 5).  This Lambda is easier to compute than the Tau-B, but as Blalock notes, "it has the undesirable property that it may take on a numerical value of zero in instances where all of the other measures we have considered will not be zero, and where we would not want to refer to the variables as being uncorrelated or statistically independent." Ibid. p. 310.
