quick question re: bernoulli models

103 views
Skip to first unread message

Paul Lantos

unread,
Aug 21, 2017, 6:34:09 PM8/21/17
to brms-users
If I don't specify otherwise, am I correct that the estimate (and predictions) from a bernoulli model in brms is in odds (and not log-odds)? Thanks.

Paul Buerkner

unread,
Aug 21, 2017, 6:58:08 PM8/21/17
to Paul Lantos, brms-users
The logit link is applied by default as in nearly all other packages for binary regression. So the results as log odds.

Am 22.08.2017 12:34 vorm. schrieb "Paul Lantos" <paul....@gmail.com>:
If I don't specify otherwise, am I correct that the estimate (and predictions) from a bernoulli model in brms is in odds (and not log-odds)? Thanks.

--
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/2fa3369f-346d-4ca6-86c1-e7a6427479e0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Paul Buerkner

unread,
Aug 21, 2017, 6:59:30 PM8/21/17
to Paul Lantos, brms-users
The predictions however are either 0 1 (for predict) or the predicted probabilities of an event (for fitted).

Am 22.08.2017 12:34 vorm. schrieb "Paul Lantos" <paul....@gmail.com>:
If I don't specify otherwise, am I correct that the estimate (and predictions) from a bernoulli model in brms is in odds (and not log-odds)? Thanks.

--

Paul Lantos

unread,
Aug 21, 2017, 7:07:17 PM8/21/17
to Paul Buerkner, brms-users
Ok - makes sense now that I look at it:

I'm working with a proportion of 600 1s to 19,000 0s in my primary data (0.03 so odds would be 0.03 / 0.97 ~ 0.03). Predictions range from 0.02 to 0.04, which makes sense if there's variability about this 0.03, so this seems like it's on an odds scale. But in the primary model summary the intercept is -3.35, which is log(0.03).

Paul Buerkner

unread,
Aug 21, 2017, 7:09:19 PM8/21/17
to Paul Lantos, brms-users
Predictions are not odds, they are probabilities.

Paul Lantos

unread,
Aug 21, 2017, 7:15:42 PM8/21/17
to Paul Buerkner, brms-users
I see - so that then is why the prediction is similar to the real-world proportion I suppose.

The reason I'm asking is that I am computing a spatial odds ratio in which I've got predictions from a spatial model and predictions from an aspatial model. So to compute the OR I'd convert these predictions from probability to odds, then just do a ratio?

This is different than my workflow in mgcv where we dosomething like exp(predict(mod, newdata) - mean(predict(aspatial.mod, newdata)) to generate pointwise OR.

Paul Buerkner

unread,
Aug 21, 2017, 7:18:18 PM8/21/17
to Paul Lantos, brms-users
Yes, indeed. This seems reasonable. Depending on your exact question, using fitted might be more appropriate then predict (in brms), if you don't want to include sampling error in your predictions.

Paul Lantos

unread,
Aug 21, 2017, 7:23:27 PM8/21/17
to Paul Buerkner, brms-users
Thanks, yeah since our prior conversations about this I've just been using fitted() for my applications.

Paul Lantos

unread,
Aug 21, 2017, 8:31:12 PM8/21/17
to Paul Buerkner, brms-users
Here's a related question - this is a marginal_effects() plot. Y axis / response variable looks like probability. I assume X axis is in the native units of the predictor? (In this case standardized and centered, so the X units are in standard deviations with a mean of 0).

Inline image 1

Paul Buerkner

unread,
Aug 22, 2017, 3:12:35 AM8/22/17
to Paul Lantos, brms-users
Yes you are exactly right.
Reply all
Reply to author
Forward
0 new messages