Posterior sampling of beta difference

39 views
Skip to first unread message

Edward Patzelt

unread,
Apr 12, 2018, 1:46:02 PM4/12/18
to brms-users
Hi brms-users,

I'm new to Bayesian approaches, but I'm trying to do the following. In the graph below we want to examine "the difference between differences". In other words, we want to find the posterior proportion of "the comparison of the beta difference (low vs high stakes) between young and old", where young has a greater stakes difference than old.

This would tell us the posterior probability that the stakes effect is larger for young than for old.

The graph below comes from a simple model with the default settings and is plotted using marginal_effects().

mod <- brm(W~stakes*ageFactor+IQ+gender, data=dat2)




Paul Buerkner

unread,
Apr 13, 2018, 9:46:18 AM4/13/18
to Edward Patzelt, brms-users
I suggest you take a look at the "hypothesis" method, which allows you to specify and compute exactly the contrasts you need.

--
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/ca37a499-a48a-42f4-bce6-560e07c222fa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Edward Patzelt

unread,
Apr 16, 2018, 1:58:50 PM4/16/18
to brms-users
Thanks Paul, just so I'm crystal clear on using hypothesis. The default for factors is to dummy code them. So hypothesis(model, "stakeshighStakesW:ageFactoryoung < 0") is telling me the evidence ratio that "highStakesW - lowStakesW is greater for young than for old"?

With the results indicating there is not a significant difference in "stakes" between young and old.

W ~ stakes * ageFactor

Hypothesis Tests for class b:
                         Estimate Est.Error l-95% CI u-95% CI Evid.Ratio Star
(stakeshighStakes... < 0    -0.07      0.08     -Inf     0.06       4.38   



On Friday, April 13, 2018 at 9:46:18 AM UTC-4, Paul Buerkner wrote:
I suggest you take a look at the "hypothesis" method, which allows you to specify and compute exactly the contrasts you need.
2018-04-12 19:46 GMT+02:00 Edward Patzelt <pat...@g.harvard.edu>:
Hi brms-users,

I'm new to Bayesian approaches, but I'm trying to do the following. In the graph below we want to examine "the difference between differences". In other words, we want to find the posterior proportion of "the comparison of the beta difference (low vs high stakes) between young and old", where young has a greater stakes difference than old.

This would tell us the posterior probability that the stakes effect is larger for young than for old.

The graph below comes from a simple model with the default settings and is plotted using marginal_effects().

mod <- brm(W~stakes*ageFactor+IQ+gender, data=dat2)




--
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,
Apr 17, 2018, 3:09:52 AM4/17/18
to Edward Patzelt, brms-users
This interpretation seems correct to me.

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.

Edward Patzelt

unread,
Apr 17, 2018, 12:57:26 PM4/17/18
to brms-users
Thanks Paul!
Reply all
Reply to author
Forward
0 new messages