I'm searching for the possibility to calculate the coefficients from a logistic regression with reference coding by using the coefficients of the logistic regression with effect coding (using the same data of course). I thought I found the solution with these formulas:

$$ \beta _{k,i} = \gamma_{k,i} +\sum_{j<m} \gamma_{k,j} \,\,\,\, respectively \,\,\,\, \beta _{0,0} = \gamma_{0,0} -\sum_{k \neq0} \sum_{j \neq0} \gamma_{k,j} $$ $$ \gamma _{k,i} = \beta_{k,i} -\frac{1}{m} \cdot \sum_{j<m} \beta_{k,j} \,\,\,\, respectively \,\,\,\, \gamma_{0,0} = \beta_{0,0} +\frac{1}{m} \cdot \sum_{k \neq0} \sum_{j \neq0} \gamma_{k,j} $$ with $k$ the number of the $k$-th dummy category,

$m$ the number of categories within category $k$,

$\beta_{k,i}$ the $i$-th coefficient of category $k$ of the reference coded regression

$\gamma_{k,i}$ the $i$-th coefficient of category $k$ of the effect coded regression

and $\gamma_{0,0}$ and $\beta_{0,0}$ the intercepts.

Now, I found out that these formulas work for models with additional metric variables as well, but only for the coefficients of the independent variables and not for the intercepts. Can somebody explain why the formulars don't work or are there mistakes in the formulas for the intercepts?

On this page there is a nice example:


Examples out of this models for calculation:

Model 1:

 26.15 + (1/3)*(-1.17-1.85) = 25.14
 -1.17 - (1/3)*(-1.17-1.85) = -0.16

Model 2:

 25.88 + ((1/9)*(-0.73-1.49-0.48+2.42+0.2-0.41)) = 25.83 != 25.10
 -0.73 - (1/3)*(-0.73-1.49)                      =  0.01

1 Answer 1


I found the mistake by myself. Here are the correct formulas for everybody who is interested in this topic:

$$ \beta _{k,i} = \gamma_{k,i} +\sum_{j<m_k} \gamma_{k,j} \,\,\,\, respectively \,\,\,\, \beta _{0,0} = \gamma_{0,0} -\sum_{k \neq0} \sum_{j < m_k} \gamma_{k,j} $$ $$ \gamma _{k,i} = \beta_{k,i} -\frac{1}{m_k} \cdot \sum_{j<m_k} \beta_{k,j} \,\,\,\, respectively \,\,\,\, \gamma_{0,0} = \beta_{0,0} + \sum_{k \neq0} \frac{1}{m_k} \sum_{j < m_k} \gamma_{k,j} $$

and the reference category is always numbered as category $m_k$ from the possibilities $1,...,m_k$. The results of the examples in the question are correctly calculated then.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.