# Multinomial logistic analysis

I am estimating a logistic model for a binary $Y$ (0=controls, 1=cases), and a set of covariates ($x_1, x_2, x_3, \ldots$) including sex (male, female). I know from the data that risk of $y$ is quite different for males and females with certain covariates.

What I was trying to do, with no success so far, was to fit one single model for entire data to get estimates for $x_1, x_2, x_3$ for example, and gender specific OR for let's say $x_4, x_5$.

I am totally confused with terminology: I have tried nested analysis (which does not apply here because I have one observation per subject), multilevel modeling, and multinomial (0=controls, 1=male cases, 2=female cases). Multinomial seems like what I need, but in Stata that I am using, mlogit gives me coefficients for y=1 and y=2 for all covariates, and I can not figure out how to get aggregate coefficients for all male and female cases for certain set of covariates (which are not supposed to be gender-specific). There must be some straightforward way to get OR for both from the same model, without manually calculating the coefficients and CIs.

Any suggestions would help.

• The form of regression you want depends on the nature of the dependent variable. SO, what is y? – Peter Flom Aug 13 '13 at 20:46
• This is not a case/control study. Y is outcome of a screening test to identify positive cases of an infection among a cohort. – farnaz Aug 13 '13 at 21:47
• If Y is dichotomous (e.g. sick/not sick) you want bivariate logistic. Using "controls" and "cases" in this way is going to cause a lot of confusion, I suggest changing the terms. – Peter Flom Aug 13 '13 at 21:48

In Stata that supports factor variables, you need something like

 logit y x1 x3 x3 ibn.gender#(ibn.x4 c.x5)


where the last term is the interaction of gender with a categorical x4 and a continuous x5.

• thank you @StasK. I did use something similar to your suggestion. The problem is that it gives me one reference level (i.e. gender=female, x4=0). What I need is to compare different levels of x4 within males, and within females. Not males to females. females with females. – farnaz Aug 14 '13 at 19:54
• Read on factor variables in Stata. There are multiple ways to specify these interactions, and you can find the one that works for you. See also the updated syntax. – StasK Aug 15 '13 at 12:09
• A couple of the tricks that @StasK refers to are discussed in M.L. Buis (2012) "Stata tip 106: With or without reference", The Stata Journal, 12(1), pp. 162-164. maartenbuis.nl/publications/ref_cat.html – Maarten Buis Aug 15 '13 at 12:35

Your response can't logically be controls or male cases or female cases, for two reasons:

• The difference between controls and cases is given by the study design; it is not an outcome or response.

• The difference between males and females likewise is given at the beginning of the study and presumably is unchanged throughout. That's not an outcome or response either.

But, as @Peter Flom also suggests, I can't follow from this what is the response any way? As terminology can be a problem, note that response, outcome or dependent variable are some of the terms in widespread use. It's whatever you want to explain and/or predict.

• You are correct. It could be terminology. I commented on @Peter Flom's answer. I am trying to predict odds of becoming a case given certain covariates. – farnaz Aug 13 '13 at 21:50
• If you response is something like case of disease (or not a case) I woudn't call that case and control. – Nick Cox Aug 13 '13 at 21:58

So there's kind of a lot going on here. I don't think multinomial regression is what you want here, for a few reasons. First, you won't be able to get those aggregate coefficients. But more importantly the thing you're trying to predict (I assume) is whether the person is a case or control, not their gender. You want to understand odds ratios for gender, which means running a straightforward regression with gender as a predictor is better.

In particular, you'll want to include gender as a variable and potentially as an interaction term, especially for any covariates you think might be impacted by gender. The coefficients for gender from the model should let you calculate OR in a straightforward manner. Running men and women separately is also an option but that is equivalent to including a single interaction term for gender with all other variables simultaneously.

If you want a gender specific OR for only $x_4$ and $x_5$ then you should include gender as an interaction with those variables specifically.

• I am thinking of interaction terms. Maybe defining the correct reference level will solve my problem. I need to use all males with x4=0 as reference for example (male=1 & x4=0). – farnaz Aug 13 '13 at 21:54