# What is the choice of statistical test when the dependent variable is binary but independent variable is multinomial

What is the choice of statistical test if you have a binary dependent variable but a multinomial independent variable?

Example will be Outcome - Good skin vs Bad skin Skin Care product - A vs B vs C vs D

If we use the chi-squared test it is possible to determine if there is a significant difference between the groups but are we able to generate odds ratios?

My understanding for logistic regression is that you can analyse binary dependent variables with multiple independent variables which are either binary or continuous? But in this case I only have only 1 independent variable with multiple categories

Logistic regression with a categorical predictor having more than two levels isn’t a problem; you simply use dummy variables. With a four-level predictor, you would construct (or let your analysis software construct) three dummy variables. Suppose you had the following data:

A  Good     B  Good     C  Good     D  Good
A  Good     B  Good     C  Good     D  Bad


Let’s create three dummy variables (d1, d2, d3) for skin care product, using level D of the predictor as the reference level.

   d1  d2  d3
A  1   0   0
B  0   1   0
C  0   0   1
D  0   0   0


Regressing the binary outcome variable (coding “Good” as 1 and “Bad” as 0) onto the three dummy variables in a logistic regression gives coefficients of 2.7726, 1.7918, and 0.9808 for d1, d2, and d3, respectively. Applying exp() to these coefficients gives odds ratios of 16, 6, and 2.667. We see in the data that when the product is A, the odds of “Good” vs “Bad” are 4/1 = 4. For reference category D, the odds are 1/4=0.25. Therefore, the odds ratio is 4/0.25 = 16. Similarly, the odds ratio for level C vs. level D (corresponding to d3) is (2/3)/(1/4) = 2.667.

You can do a chi-squared test (or a non parametric equivalent such as Fisher's exact test) and compute odds ratio based on the contingency table. For instance, if your contingency table looks like

$$\begin{array}{c|c|c} & Y=0 & Y=1\\ \hline X=0 & a & b \\ X=1 & c & d \\ X=2 & e & f \end{array}$$

where $X=0$ is the reference, then the two odds ratio will be

$OR_{X=1\, vs\, X=0}=\frac{da}{cb}$ and $OR_{X=2\, vs\, X=0}=\frac{fa}{eb}$.