plot_predictions for a subset of groups #811
-
|
I'm fitting a hierarchical model specified as: model = bmb.Model(
"y ~ (1|group_id) + x1 + x2",
data,
family="t"
)so I have two fixed regressors and the intercept varying by group. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
|
Hey @andins thanks for raising the discussion. Yes, this should be possible. You would want to pass a specific subset of I imagine something like the following bmb.interpret.plot_predictions(
model=...
idata=...
conditional={
"group_id: [50, 51, 52, 53, 54, 55, 150, 151, 152, 153, 154, 155],
"x1": np.linspace(x1.min(), x1.max(), 50),
"x2": np.mean(x2)
),
subplot_kwargs={"main": "x1", "group": "group_id", "panel": "group_id"}
)which would plot a panel for each |
Beta Was this translation helpful? Give feedback.


Hey @andins thanks for raising the discussion. Yes, this should be possible. You would want to pass a specific subset of
group_idvalues toconditional. Optionally, you could also passx1andx2. Otherwise, if you don't pass terms toconditionalthat were in the model, then we compute default values.I imagine something like the following
which would plot a panel for each
group_id.