# Bayesian Binary Logistic Regression

I have simulated some data and am trying to conduct a binary logistic regression on it.

1. Are the evidence ratio equivalent to Bayes factor in this case?
2. How do I check if the model fits the data?

GM and FB are binary and categorical
Age is continuous

``````#Regression for Age
BayesGM1 <- brm(formula = FB ~ Age,
data = G, family = bernoulli(link = "logit"),
warmup = 500, iter = 2000, chains = 2, inits= "0",cores=2, seed = 123)

# Regression BF for Age
BayesGM2 <- brm(formula = FB ~ Age + GM,
data = G, family = bernoulli(link = "logit"),
warmup = 500, iter = 2000, chains = 2, inits= "0",cores=2, seed = 123)

# interaction term
BayesGM3 <- brm(formula = FB ~ Age + GM + GM*Age,
data = G, family = bernoulli(link = "logit"),
warmup = 500, iter = 2000, chains = 2, inits= "0",cores=2, seed = 123)

brms_SummaryTable(BayesGM1, astrology=TRUE, hype=TRUE, panderize=TRUE, justify='lrrrrclr')
brms_SummaryTable(BayesGM2, astrology=TRUE, hype=TRUE, panderize=TRUE, justify='lrrrrclr')
brms_SummaryTable(BayesGM3, astrology=TRUE, hype=TRUE, panderize=TRUE, justify='lrrrrclr')
``````
• Operating System: Mac OS Catalina
• brms Version: 2.14.4

Welcome to the community!

1. if you want model comparison I’d recommend using LOO instead.
2. Here’s a start: PPCs for discrete outcomes — PPC-discrete • bayesplot (and you could use Bayes R^2 etc. also). Here’s also more information: http://www.stat.columbia.edu/~gelman/research/published/dogs.pdf
1 Like

Thanks. I am new to both Statistics and R language. I was looking to compute Bayes factor at first using a different package altogether but couple of people suggested me brms so gave that a try. Unfortunately, I am unable to understand the outcomes and how can I compare and present it in a paper.

I will have a look at your suggestions.

Thanks again

You can find examples of people using Bayes factors for brms models here and here. However, I agree with @torkar’s recommendations. Folks on the Stan discourse tend to prefer comparing models with LOO over the Bayes factor method.

Thanks Solomon