Simple slopes in brms?

180 views
Skip to first unread message

Zachary Horne

unread,
Feb 20, 2018, 10:44:46 AM2/20/18
to brms-users
Hi,

I have a basic question about getting simple slopes from a model like this:

a = gender
b= likert scale 
c = phd or no phd

DV ~ a + b + c + a*b

I'm hoping to get the simple slopes from the interaction term in this model. Is there a straight forward way to do this in brms?

Thanks!

Zach

Paul Buerkner

unread,
Feb 20, 2018, 12:43:14 PM2/20/18
to Zachary Horne, brms-users
You can easily vizualize the interaction via marginal_effects(fit, "b:a") or marginal_effects(fit, "a:b").

Is this what you have in mind?




--
You received this message because you are subscribed to the Google Groups "brms-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brms-users+unsubscribe@googlegroups.com.
To post to this group, send email to brms-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brms-users/c6bbee27-5755-43c3-859b-708351975c2d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Zachary Horne

unread,
Feb 20, 2018, 12:55:13 PM2/20/18
to brms-users
Hi Paul,

Thanks for the reply. I figured out how to visualize the effects without a problem using marginal effects. However, I want to be able to actually report the slope of the likert scale ratings predicting the DV for men and women separately. This is clearly being displayed in the marginal effects plot which makes me think there is a way to extract this information from whatever is creating that plot. 

On Tuesday, February 20, 2018 at 10:43:14 AM UTC-7, Paul Buerkner wrote:
You can easily vizualize the interaction via marginal_effects(fit, "b:a") or marginal_effects(fit, "a:b").

Is this what you have in mind?



2018-02-20 16:44 GMT+01:00 Zachary Horne <zach.s...@gmail.com>:
Hi,

I have a basic question about getting simple slopes from a model like this:

a = gender
b= likert scale 
c = phd or no phd

DV ~ a + b + c + a*b

I'm hoping to get the simple slopes from the interaction term in this model. Is there a straight forward way to do this in brms?

Thanks!

Zach

--
You received this message because you are subscribed to the Google Groups "brms-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brms-users+...@googlegroups.com.

Paul Buerkner

unread,
Feb 20, 2018, 4:59:14 PM2/20/18
to Zachary Horne, brms-users
Suppose that a is dummy coded with male as the reference category.

Then (the coefficient) b is the slope for males, b + b:afemale is the slope for femals, and b:afemale is the difference of the slopes.

With exception of b + b:afemale, you can directly extract the coefficients from the summary output. For b + b:afemale, you write

hypothesis(fit, "b + b:afemale = 0")

To unsubscribe from this group and stop receiving emails from it, send an email to brms-users+unsubscribe@googlegroups.com.

To post to this group, send email to brms-...@googlegroups.com.

Zachary Horne

unread,
Feb 20, 2018, 7:16:18 PM2/20/18
to brms-users
Hi Paul

This is really helpful. Thanks!

Zach
Reply all
Reply to author
Forward
0 new messages