# Testing significance for two groups with dichotomous variables

Is a 2x2 table/Chi-square test an appropriate method if I have a set of data with two dichotomous variables like so:

Location Heavy User Very Heavy User
Urban 10 5
Rural 20 30

or similarly

Location Male Female
Urban 10 5
Rural 20 30

I want to test to see if either group is significantly more likely to be in a certain location (e.g. those in rural locations are more likely to be female, or those in rural locations are more likely to be very heavy users).

I am slightly confused as neither variable is a simple positive or negative, which most examples work through (e.g. smoking or non-smoking status).

• Do you have the data for each individual? That is, do you know the gender, location & use of each subject? Jan 21, 2023 at 11:24
• @dipetkov Yes I have a full set of data, with a line for each individual. Jan 21, 2023 at 11:31

## 1 Answer

Yes, this is perfectly fine, as this would constitute a chi-square test of independence. For some examples of chi-square tests, check this link. The one very minor caveat I would make here is that you should be certain that the "urban" and "rural" populations are actually distinct. It is one of a handful of assumptions required for chi-square testing that the groups are totally independent. With geographical location, this might be a bit gray, but I think this would still be reasonable to run.

Remember though that chi-square tests don't speak much about the directionality of relationships, only that the frequencies are different than what we would expect under the null hypothesis. You can say that some groups constitute more weight in the relationship by looking at the observed frequencies and seeing which are abnormally high/low, but this isn't formally tested under the chi-square test. As an example of why, check this answer.

• Great thank you very much, that clears it up. Locations should be OK as the individuals have been categorised based on full addresses using standardised city boundaries. Jan 21, 2023 at 11:53
• As you mention, In terms of reporting If I run the first example through SPSS and it gives me a significant value and then a Risk Estimate table with an OR for Urban or (Rural / Urban) of 3" is it appropriate to report this as Rural Individuals are more likely to be Heavy users (with OR and CI reported also)? or are further tests required? thanks! Jan 21, 2023 at 11:59
• If you are using SPSS, you could consider adding some post-hoc tests to your results: youtu.be/cOu9rv83G-I Jan 21, 2023 at 12:26