# Intercept in a Bayesian model with categorical predictors (with brms)

I have a Bayesian logistic model fitted in R with brms. The predicted variable is binomial, the predictors are categorical. The model uses bernoulli family and a logit link, and an uninformative Student-t prior.

This is my model:

isTrue ~ Type * Language + (Type | participant) + (1 | item)

Basically every participant gets items in a certain language, every item has a certain word type in it. Type is a 3-way factor (1/2/3), language is 5-way (DE/EN/ES/FR/IT).

This is my model output:

Population-Level Effects:
Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
intercept                    -3.46      0.40    -4.28    -2.73       1966 1.00
Type2                         2.23      0.44     1.39     3.11       2120 1.00
Type3                         0.38      0.53    -0.69     1.42       2294 1.00
LanguageEN                    0.29      0.51    -0.71     1.29       2864 1.00
LanguageES                    4.03      0.42     3.25     4.89       1999 1.00
LanguageFR                    2.34      0.43     1.54     3.20       2093 1.00
LanguageIT                   -2.58      1.27    -5.64    -0.69       1557 1.00
Type2:LanguageEN             -0.19      0.57    -1.33     0.90       3108 1.00
Type3:LanguageEN             -0.48      0.68    -1.79     0.87       3422 1.00
Type2:LanguageES             -1.15      0.49    -2.14    -0.20       2394 1.00
Type3:LanguageES              0.95      0.60    -0.21     2.12       2464 1.00
Type2:LanguageFR             -0.86      0.50    -1.85     0.10       2561 1.00
Type3:LanguageFR             -0.07      0.59    -1.24     1.07       2482 1.00
Type2:LanguageIT              6.32      1.32     4.28     9.42       1631 1.00
Type3:LanguageIT              7.96      1.36     5.84    11.13       1608 1.00


With this kind of output, I'm comparing everything to an intercept that does not make much sence (Type1:LanguageDE). Nor would another, e.g. Type3:LanguageEN make any more sense.

This may be an ignorant question but I haven't come across this before: is there a way to have no default intercept and all features in the population-level effects, with an intercept that does not represent any real feature but maybe an average across features, or something like that? This intercept I'm imagining would say "across types and languages, this is how True x is". Is this theoretically sound and if so, how can this be done?

I tried defining the model with isTrue ~ 0 + ... but the output is virtually identical, plus I'm not sure this is what the syntax means. Using isTrue ~ 0 + factor(Type) * factor(Language) I get no intercept and all Types in the output, but still no DE in the language; and to do this I have to remove grouping factors.

Thanks!

It seems you have difficulty on understanding and manipulating 15 fixed effects in your model.

Then you can fit an equivalent model which is clearer and more understandable than your original model.

Let $$X_{ij} = 1$$ if type = $$i$$ and language = $$j$$-th language in your list, =0 otherwise, for $$i = 1, 2, 3$$ and $$j=1,...,5$$. Then fit a model: $$\text {logit}(P(Y=1)) = \sum_{i=1}^3 \sum_{j=1}^5 \beta_{ij}X_{ij} + \text{ random part}$$

This model is equivalent to your original model, but each fixed effect $$\beta_{ij}$$ has clear meaning. Then you can contract linear combinations of $$\beta_{ij}$$ based on what you want and test/estimate them.

In this model, $$\beta_{ij} = \text{log(odds)}$$ for type $$i$$ and language $$j$$.

Estimate the difference of mean log odds between EN and overall average: $$(\beta_{14} + \beta_{24} + \beta_{34})/3 - \text {(sum of 15} \beta_{ij})/15$$

• Thanks! I'm not totally sure I understood though. I now coded contrasts differently, this way: DE 1 0 0 0 0, EN 0 1 0 0 0, ES 0 0 1 0 0, FR 0 0 0 1 0, IT 0 0 0 0 1. And the same goes for Type. The results of the model are now making more sense, but they are much less "significant" (doing a Test for Practical Equivalence, nothing can be safely rejected). The model also took much longer to compute. Am I missing something? – Luca Aug 12 '19 at 15:51
• The model I proposed is a stupid model. But it is easy to understand. You need to generate 15 dummy variables, each for a combination of type and language. Then fit a model without intercept. You should get 15 estimates of beta. After model fitting, you can tell me want you want, and I can give you the answers. – user158565 Aug 12 '19 at 16:07
• It took one hour and didn't converge as perfectly but it worked, thank you again. It is quite different from what I'm used to in my field though. This model with 15 variables being a 3x5 combination of two variables perfectly describes the data, but how do I get the estimates for one of the languages or the types out of any interaction effect? Something allowing me to say, e.g. "In general, FR language has fewer True responses". It's mostly a problem of reporting it, I guess. – Luca Aug 12 '19 at 17:35
• "FR language has fewer True responses" than ? (DE, EN,...or something else)? – user158565 Aug 12 '19 at 17:41
• Than the average amount of True responses across languages – Luca Aug 12 '19 at 17:42