# Determine if two variables

I would like to know which test can be used in this situation:

Suppose we have essentially a categorical variable, like gender. The observations for gender are divided by some other variable, e.g. "is employed" vs "not employed". I would like to find a test which compares the "distributions" of gender and determines if there is a significant difference between the two.

So H0: There is no difference between the two groups. H1: there is a difference.

Normally, I would use chi-square test to determine if the single cells are different, but here I am interested if there is a difference overall.

Note: a special case might be a situation where the categorical variable was originally a numeric variable but was transformed into a categoric variable, e.g. income -> income_groups.

• For analysis of contingency tables of male/female (or income groups) vs employed/not_employed, chi-square or non-parametric Fisher's exact tests seem to be the only options.
– rnso
Mar 18, 2015 at 11:31
• @rnso There's two sample proportions tests (though two-tailed versions will be equivalent to a chi-square), there's the G-test -- indeed the whole gamut of power-divergence tests, and indeed, there are still more tests that could be applied. Mar 18, 2015 at 12:11
• @Glen_b : For contingency tables of male/female (or income groups) vs employed/not_employed, would'nt chi-square or Fisher's test be recommended vast majority of time?
– rnso
Mar 18, 2015 at 12:26
• @rnso That depends on who is doing the recommending. People who think that chi-square or Fisher's exact tests are the only options are hardly going to recommend anything else. Papers that compare G-tests with the usual Pearson chi-square tests often recommend the G-test. Papers that compare both of those with other power-divergence statistics tend to choose something else again. If you need a one-tailed test, the chi-square isn't much use. When sample sizes are very small, something else may be better again. While $χ^2$ & Fisher are most often recommended, that doesn't necessarily tell us much Mar 18, 2015 at 12:36
• None of that's to say the tests you mention are bad, however. The point was in response to your statement that they were the only options, when they clearly aren't - and neither are they necessarily the best possible options. Often, one or the other may be reasonable choices. Mar 18, 2015 at 12:39