# Complex hierarchy in bambi, is this possible?

**URL:** <https://discourse.pymc.io/t/complex-hierarchy-in-bambi-is-this-possible/16996>\
**Category:** version agnostic\
**Tags:** bambi\
**Created:** [May 13, 2025, 3:57pm UTC](https://discourse.pymc.io/t/complex-hierarchy-in-bambi-is-this-possible/16996 "2025-05-13T15:57:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cricket4444](https://avatars.discourse-cdn.com/v4/letter/c/f04885/32.png) [@Cricket4444](https://discourse.pymc.io/u/Cricket4444)\
**Post date:** [May 13, 2025, 3:57pm UTC](https://discourse.pymc.io/t/complex-hierarchy-in-bambi-is-this-possible/16996/1 "2025-05-13T15:57:21Z")

</div>

I’m using a GLM to model some treatment effects, in the simplest form it looks like this:

```auto
mu = 1 + treatment:individual

```

however my subjects are categorized in groups, I want to build a hierarchy, so that the individuals within the group pool the data across each other, but not between the groups. I tried this:

```auto
mu = 1 + treatment:individual|group

```

but it does not work as expected.

---

<div class="post-metadata">

**Author:** ![ricardoV94](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/ricardov94/32/5775_2.png) [@ricardoV94](https://discourse.pymc.io/u/ricardoV94)\
**Post date:** [May 13, 2025, 8:13pm UTC](https://discourse.pymc.io/t/complex-hierarchy-in-bambi-is-this-possible/16996/2 "2025-05-13T20:13:56Z")

</div>

CC @tcapretto

---

<div class="post-metadata">

**Author:** ![tcapretto](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/tcapretto/32/4902_2.png) [@tcapretto](https://discourse.pymc.io/u/tcapretto)\
**Post date:** [May 14, 2025, 6:39pm UTC](https://discourse.pymc.io/t/complex-hierarchy-in-bambi-is-this-possible/16996/3 "2025-05-14T18:39:55Z")

</div>

Could you tell me a bit more about the problem and the data? Are subjects exposed to multiple treatments? Or why are you looking for the interaction between `treatment` and `individual`?
