When we perform a regression analysis with categorical predictors, we can use (1, 0), called "dummy coding". The coefficients in this case represent the deviation of the groups' means from the mean of the reference group. We can also use (1, 0, -1), called "effect coding" the coefficients in this case represent the deviation of the groups' means from the grand mean. But what if we did our analysis by excluding the intercept column from our matrix and without setting a reference group? $$ Y_{ij} = \mu_j + \varepsilon_{ij} $$ with $j = 1, \ldots, k$ factors, and $i = 1, \ldots, N$ observations. If $X$ is the design matrix, the model could be: $$ {\bf Y} = {\bf X}u + e $$ $$ {\bf Y} = \begin{pmatrix} Y_{11} \\ \vdots \\ Y_{1j} \\ \vdots \\ Y_{Nk} \end{pmatrix}, \qquad {\bf X} = \begin{pmatrix} 1 &0 &\cdots &0 \\ \vdots &\vdots &\cdots &\vdots \\ 1 &0 &\cdots &0 \\ \cdots &\cdots &\cdots &\cdots \\ 0 &\cdots &0 &1 \\ \vdots &\cdots &\vdots &\vdots \\ 0 &\cdots &0 &1 \end{pmatrix}, \qquad \mu = \begin{pmatrix} \mu_1 \\ \vdots \\ \mu_k \end{pmatrix} $$

Then the coefficients would represent the groups' means, is that right? Would that be average or mean coding?


1 Answer 1


Yes, that can be done, and is done occasionally. What you have is called "level means coding". For more on this, it may help you to read my answer here: How can logistic regression have a factorial predictor and no intercept? For an example of a case where I found it convenient to use level means coding, see: Why do the estimated values from a Best Linear Unbiased Predictor (BLUP) differ from a Best Linear Unbiased Estimator (BLUE)?

There are a couple of things to be aware of when you use level means coding. First, you must suppress the intercept to avoid having perfect multicollinearity; see: Qualitative variable coding in regression leads to “singularities”). Second, the meaning of the hypothesis tests is different: they are now tests of whether the means differ from $0$, not whether they differ from each other; see: Understanding dummy (manual or automated) variable creation in GLM.

  • $\begingroup$ But in the hypothesis tests if i test whether the means differ from each other , that means i test whether the total factor has influence on the dependent variable ? $\endgroup$ Commented Jul 2, 2015 at 23:15
  • 2
    $\begingroup$ @Bahgat-Latakia, assuming we are talking about a one-way ANOVA, you would drop the entire factor & fit a model with only a global mean. Then you would perform a nested model test. That is a test of the factor as a whole. Note that the test would not differ based on whether your full model were coded using reference level coding, effect coding, or level means coding. If you don't perform the nested model test (or form a regular ANOVA table), but just look at standard output, the meaning of the reported t-tests will differ, that's what I was getting at. There's more information at the link. $\endgroup$ Commented Jul 2, 2015 at 23:20

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.