Short summary of the problem
Hello! I’ve just started using brms, and I’m really amazed at how good it is, especially compared other other MLM packages that I’m unfortunately more used to. I’ve found the documentation for conditional_effects very useful, but I still have not managed to figure out a couple of questions and would really appreciate any help.
With the conditional_effects() command, I’m trying to plot interaction effects of a logit regression. The predictor variable (VIOLENCE) that comes on the x axis is binary, and the moderating variable (STR.factor) is a factor with five levels (“0”,“1”,“2”,“3”,“4”). I’ve attached a small dataset and a simple regression for illustration:
lv1_violxstr <- brm(SUI_CON ~ VIOLENCE*STR.factor, data=smalldat, family=‘bernoulli’)
smalldat.csv (16.5 KB)
I want to
1. Plot in a log-odds scale and not in a probability scale
2. Use just some of the values of the moderating variables. For continuous moderators, I could just use the int_conditions option, like int_conditions = list(x1=c(-0.12, 0.12)). However, for my factor moderator variable STR.factor, I have not been able to make any changes to the plot by adding int_conditions = list(STR.factor=c(“0”, “4” )). I wonder why?
3 Finally, how could I change the moderator variable name shown in the legend?
For all three questions, I’ve tried to manipulate the data.frame obtained by
conditional_effects(lv1_violxstr_dummy,“VIOLENCE:STR.factor”)$VIOLENCE:STR.factor
, but just can’t get it to plot it in the way I described.
Thanks a lot!
- Operating System: Windows 10
- brms Version: 2.12.0