# Stat test to use with nominal variables

I have a research question looking at whether one level of a nominal variable is more likely to elicit an action than another. We are using a control and experimental group so our IV is either presence or no presence.

Secondly, our DV is nominal with two levels.

I was wondering what statistical test would be best to use given these circumstances.

• You can call binary variables nominal if you wish, but scored 0, 1 they are indicators and you can average them. With 7 females and 3 males and scoring 1 for female your average is 0.7, the proportion female. So, they can be manipulated in ways that generic nominal variables cannot. For communication, stress that you have binary variables. Jun 15, 2015 at 8:11

dependending on your sample size, the analysis can be (1) exact logistic regression or (2) two-way contingency tables with Fisher's exact test

OR

try a bayesian approach. For contingency tables, one method is to estimate the expected frequencies as distributions and the other is to estimate parameters values for the terms in hierarchical log-linear models.

• Welcome to our site, Sergio!
– whuber
Jun 14, 2015 at 18:25

This seems to be classical situation for the use of Chi-squared test https://en.wikipedia.org/wiki/Chi-squared_test . The non-parameteric equivalent is Fisher exact test, especially useful for small sample sizes: https://en.wikipedia.org/wiki/Fisher%27s_exact_test . Following examples show it being done in R:

> tab
loc
sex      Lower Middle
Male      76     32
Female    48     23
>
>
> chisq.test(tab)

Pearson's Chi-squared test with Yates' continuity correction

data:  tab
X-squared = 0.051364, df = 1, p-value = 0.8207

>
> fisher.test(tab)

Fisher's Exact Test for Count Data

data:  tab
p-value = 0.7418
alternative hypothesis: true odds ratio is not equal to 1
95 percent confidence interval:
0.5637837 2.2758488
sample estimates:
odds ratio
1.137191


Hope that helps.

The average proportions across the nominal variable groupings can be tested for rate differences as suggested. The Tukey test for two group comparisons would be one appropriate test, based on the information supplied. As noted, chi-square tests across the two-way table of observed frequencies would also work as a basic test of unrelatedness or independence. This test assumes symmetry of the rows and columns. A more appropriate test would be to use an asymmetric log-linear model where the rows (test vs control groups) predict the columns (binary outcome). For two-way tables, the answer shouldn't change, but the hypothesis and design would.

You haven't said anything about the total sample sizes. For chi-square tests, the rule of thumb is to have sample sizes 4 or 5 times the number of cells. That raises questions about type II or power errors. Do you have enough information to detect a significant and meaningful difference, if one exists? We don't know.