New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to plot random(group-based scores) effects? #637
Comments
(https://bambinos.github.io/bambi/notebooks/hierarchical_binomial_bambi.html), comparing two data on the same variable (this is exactly what I want to do but with categorical response). However, the problem is it is almost impossible to apply the same method on data with more than 14000 obs! |
@fatihbozdag thanks for opening the issue! Could you share a reproducible example (with some data) so I can better help you? The data of course does not need to be real. It can be either simulated or anonymized |
Sure thing, Indeed, I've uploaded pickled inference data https://figshare.com/articles/software/results_pickle/21789347
|
I'm not sure I understand exactly what you want to do Are you trying to reproduce this figure? "plot ppc (probabilities) of categorical response per each variable included in the random effects" You could create a plot where on the y-axis there's the probability of the outcome, on the horizontal axis the levels of a grouping variable used in the "random effects" part, and shows multiple estimates with credible intervals (one per response level). Is that what you want? Just take into account that you'll need to pick a value for any other predictor your model may have. |
yeap, that's exactly what I want to do, plotting probabilities of A, B, and C given R1 and R2. P.S. sorry, I cannot focus on the topic and write more details as a massive earthquake struck my hometown, Adana/Turkey. Can you please gimme a few days? Currently, I work as a freelance translator to guide Rescue Teams. |
Hi again. I am back to ordinary life(sort of). How can I produce such a plot? Yeap, this is categorical regression consisting of response with 3 levels. |
update for another unsuccessful attempt; following coords = {"y_dim": ["B","C"]} ## works but not reference level, assuming "A" is the reference.
|
@fatihbozdag I'm sorry you were affected by the earthquake. I hope you're doing better now! What I don't understand from this visualization https://user-images.githubusercontent.com/59308858/216736802-9b1f1f97-80f9-4696-976d-427f8bad4c54.png is what the line represents. I guess the line is a probability going from 0 to 1, and then the closer it's to zero, the closer it's to DO, and the closer it's to one, the closer it's to PD. Is that correct? But in this case, you have three response levels, so you can't get a plot like that one. Also, you have other predictors on top of the group-level effect you're interested in ( |
Thank you, @tomicapretto, well, doing much better but the whole country is struggling and is likely to do so for a while. As of writing the post, we've just had another one (5.1) I guess, we have to get used to it. Anyways. Your interpretation is correct. Other predictors are kept at the response level since all predictors are categorical variables. to clarify,
provides such a plot. So what if I would like to get such plot per random effects? |
Greetings all,
I've been looking for a way to plot ppc (probabilities) of categorical response per each variable included in the random effects. Indeed, I asked the question in Arviz github (arviz-devs/arviz#2188) however, I couldn't find a solution yet.
So basically, following the code below;
I want to plot the probabilities of each item in the categorical response variable (3 level) per random effect(2 level). I did it before with
rstanarm
andeasystats
onR
for binomial dist, yet got stuck here onPython.
This is from my own study.
The text was updated successfully, but these errors were encountered: