# Discrepancy in odds ratios when using dummy and effect coding - which is better?

I have a binary outcome variable and several binary predictor variables. When performing a logistic regression (proc logistic) in SAS, I get different odds ratios when I take the exponent of beta, compared to the odds ratios provided by the oddsratio statement.

According to this, the difference comes about because the beta coefficients are calculated by default using effect coding, while the odds ratios calculated with the oddsratio statement are calculated using dummy variables. My question is - which one should I be using? It makes quite a difference to my results (e.g. ORs of 0.95 vs 0.57 for variable1, 1.2 vs 1.8 for variable2 for effect and dummy coding, respectively). My inclination would be to use the more conservative estimates, but I wonder if there is a more philosophical reason for using one or the other.

Here is the basic idea, assuming the simplest types of situation:

With effect coding, the coefficients that you get (on the log odds scale) for each level of the factor represent differences of that level from the intercept --- think of the intercept as the mean across the levels. The "unseen coefficient" of the reference level can be had by adding up the negative of all the seen coefficients.

With dummy coding, the coefficients that you get (on the log odds scale) for each level of the factor represent differences of that level from the reference level. The "unseen coefficient" is essentially zero, because the intercept now represents the reference level.

So, when you take the exponent in the case of effect coding, you are getting an odds ratio relative to the intercept.

When you take the exponent in the case of dummy coding, you are getting an odds ratio relative to the reference level.

My inclination would be to use the more conservative estimates, but I wonder if there is a more philosophical reason for using one or the other.

They are conservative, but only because of this special case (see below). For most categorical factors, the mean across levels would have very little meaning.

For example, say you were modeling disease as a function of sex:

Why would you be interested in the odds of disease in males relative to the mean odds of disease across males and females? That is effect coding.

You would probably be interested in the odds of disease in males relative to the odds of disease in females. That is dummy coding.

I have a binary outcome variable and several binary predictor variables.

Your case is a little special, in that you only have binary variables. In that case, then it makes sense that the distance from the reference level is always more than the distance from the mean of the two levels. That is why the odds ratios are always smaller with effect coding in your case.

You very likely want to use the dummy coding odds ratios.