Difference between model summary estimate value and the result graph slope

Hi, I am having trouble understanding the summary estimates of a specific model.
My code is

formula_full = p_negativeR  ~ Meandiff + (1|SID)
prior <- get_prior(data = newdata, bf(formula_full,family = bernoulli(link="logit")))
prior$prior[1] <- "student_t(4,0,2.5)"

emoM <- brm(
  data = newdata,
  bf(formula_full, family = bernoulli(link="logit")),
  prior = prior,
  chains = 8, iter = 6000, warmup = 1000, 
  save_pars = save_pars(all = TRUE),
  seed = 1015,

The summary of this model is
Therefore, I assumed that the slope for Meandiff would be 0.06.
However, if I calculate the slope through eyes with this graph, the slope is approximately 0.01.

Why those the two values are so different? Did I do something wrong?

Thank you for your help in advance!

newdata.csv (3.4 MB)

@birduckoo this is a generalized linear model; the coefficients are on the linear predictor scale, but the graphic is on the response scale.

Note also that the value of p_negativeR when Meandiff=0 is about 0.53, which is not even close to your Intercept, and that the line on the graphic isn’t straight. conditional_effects() returns predictions on the response scale, and you could use fitted() to obtain predictions on the linear predictor scale which would match the coefficients.

A side note is that you probably don’t need so many samples, the defaults will likely be sufficient here.

Hi, Thank you so much for your answer! I now understand.

For your side note, what is the default sample size? I saw that at least 40,000 samples would be required and the above numbers of chains, iteration, and warmup is to meet this number. Do you think that 40,000 is too much?
I run several other models outside the abovementioned model which are more complicated including interactions.

The amount of draws you need will depend, in part, by how healthy your chains are. You can get a good sense of that with the ESS statistics in the summary() output. But often times you only need 4,000 (the default) to 10,000 post-warmup draws when working with Stan.

1 Like