bambinos / bambi

BAyesian Model-Building Interface (Bambi) in Python.
https://bambinos.github.io/bambi/
MIT License
1.08k stars 124 forks source link

Question about interactions in models #831

Closed jankaWIS closed 2 months ago

jankaWIS commented 2 months ago

Hi,

First of all, thank you for your excellent example gallery on your website. I have not found a place where to ask questions about it and in one of them, you write to open an issue if there's something to add or explain better. So I hope this is the right way to ask.

I was going through this tutorial about Negative binomial regression where you present two models, one with and one without interaction between the two main effects. Eventually, it turns out that the interaction is not significant. But I would like to ask how it would look like if the interaction was significant and how to test for that.

And a follow-up question would be if the interaction was between two categorical variables. The example is between Program (3 levels: Academic, General, Vocational) and Math (score on a math test). But what if you had another three levels of a categorical variable, let's say a number of siblings given in three levels as 0, 1, or more than 1? How would you model such an interaction? And let's say that the effect of the number of siblings would be different between the different programs (as maybe parents can't afford to put their kids to better programs if they have more kids). How would you check that maybe there is an interaction between some of the programs and the number of siblings but not in other(s)?

Thank you in advance for your help.