# How to interpret odds ratio with continuous independent variable (%) that have categories in different columns?

I am using a logistic regression to model a 0/1 event with community characteristics as being my explanatory variables but my data structure is different making the interpretation hard. My unit of analysis is zip-code and for each zip-code, there are different categories of variables in different columns. For example, age has 4 categories; under 19, 25 to 34, 35 to 54, 54 to 64 and 65 above and it gives how many percent of people are under that age category for that zip-code. All the other variables are also similar such as age, race, education, marital status, income, etc. Conventionally, we interpret odds ratio as a 1 unit increase in x, we expect to see z% increase or decrease in the odds of the event happening.

Here is what my data looks like which gives % of population in that category for each zip-code but my each category itself is a variable even though bunch of them belong to same group say age or race. Usually, age or race is one variable with different coding (1,2,3) assigned to different categories such as 1-white, 2-hispanic etc but those datasets are at the individual level. Since this is at the zip-code level, it's not possible to do that which is why it is structured like this. So when I do regression I am doing using the code below and I am leaving one category out due to multicollinearity issue.

logistic y Age20to44 Age45to54 Age55to64.....

I was told to use one category as reference and when I interpret the results, interpret it by comparing to the reference category but my argument is that how would STATA or any statistical software would know that I am using that category as reference since that reference category is itself a separate variable and I leaving that out of that model. Therefore, I have 2 questions:

1. Since my explanatory variables are all in different columns even though they belong to same group such as age, race, and income, I cannot use reference category and please correct me if I am wrong, reference categories are only used when there is categorical variable which is contained all in one column?
2. How do I interpret my results? For ex. odds ratio for age20to44 is 1.02. Should I say that this age category increases the odds of the event by 2% or should I say that a unit increase in age with in this age category increases the odds of the event by 2%.

• Can you post a sample if your data so we can get a better feel for what you're working with? – Demetri Pananos Sep 29 '19 at 20:35

This is an interesting problem and not one I've thought about before, but I think we can reason through this using the standard logic of regression.

You're right in noticing that you can't include all the categories though it's because the design matrix isn't full rank, not because of collinearity (if there is an intercept in the model). In regression with an intercept, the model matrix is of the following form:

Int V2 V3 ...
1  1  0
1  0  1
1  0  0
1  1  0


etc.

A matrix is not full rank if the columns are not linearly independent of each other, meaning you can reconstruct one of the columns from the other ones. If you include an intercept in the model, you can always reconstruct the missing category from the intercept and the present categories. This is why you have to exclude one category when performing the regression. Stata doesn't know this, but if you attempt to include all the categories, it will automatically remove one because the design matrix would not be full rank otherwise. This is the same thing it would do if you were to attempt to include all the dummy indicators of a binary level with unit-level data instead of using a single categorical variable and letting Stata choose and remove the reference category.

Interpreting the coefficients on the present categories is a bit annoying. Typically, we want to interpret the coefficients as the change in log odds corresponding to a 1-unit increment in the predictor, holding other predictors constant. For the Age variables, if all categories were in the model, it wouldn't make sense to talk about changing one category while holding the others constant, because they need to add up to 100%. So, the interpretation when one of the categories is absent is the increase in the log odds when you increase the given category by 1 and decrease the reference category by 1, as if you're pouring out what's available from the reference category into the given category.

Let's say in the regression that the Age20to44 category was the reference category (and was excluded from the model), and we want to interpret the coefficient on the Age45to54 category, which we'll say was estimated to be 2. You could say "Moving 1% of a zipcode from Age20to44 to Age45to54 is predicted to increase the log odds of the event by 2*1% = .02." To avoid sounding like you're making a causal claim, you could say "For two zipcodes that have the same composition except that one has an additional percent of its population in the Age45to54 category and one less percent of its population in the Age20to44 category than the other, the former is expected to have a higher log odds of the event by 2*1% = .02."