Skip to content

plot_predictions for a subset of groups #811

Answered by GStechschulte
andins asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @andins thanks for raising the discussion. Yes, this should be possible. You would want to pass a specific subset of group_id values to conditional. Optionally, you could also pass x1 and x2. Otherwise, if you don't pass terms to conditional that were in the model, then we compute default values.

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 group_id.

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@GStechschulte
Comment options

@GStechschulte
Comment options

@andins
Comment options

@GStechschulte
Comment options

@andins
Comment options

Answer selected by andins
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants