Generally these kind of question could be expressed as a mixed effect model. You can have a look at this post: Constructing the random effects model matrix Z. @Jack_Caster’s repository https://github.com/JackCaster/GLM_with_PyMC3 is pretty great.
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| Hierarchical multiple regression with multiple level groups | 5 | 1370 | June 23, 2023 | |
| Multi-level multi-variables model | 4 | 1307 | January 5, 2018 | |
| Hierarchical Regression Model with Multiple Predictors | 1 | 860 | June 21, 2018 | |
| Incorporating multiple variables in Hierarchial model | 0 | 518 | December 30, 2022 | |
| Create a hiearchical linear regression with 5 levels | 2 | 663 | January 19, 2022 |