BRMS pp_check with logistic regression

Hi all,

I ran the following logistic regression in BRMS: Essentially I am measuring the impact of a behavior treatment. This is baseline data prior to the treatment so I expected that none of the parameters would share a reliable relationship with the probability of producing a correct response.

baseline <- brm(formula = Successes | trials(Trials) ~ Probe * AcquiGen +
(1+Probe+AcquiGen|SubjectCode) + (1|obs) + (1|Structure),
data = BLOnly,
family = binomial(“logit”),
cores = 4,
prior = c(prior(normal(0, 10), class = b),
prior(normal(0, 10), class = b, coef = AcquiGen1),
prior(normal(0, 10), class = b, coef = Probe),
prior(normal(0, 10), class = b, coef = Probe:AcquiGen1),
prior(cauchy(0, 3), class = sd, group = “obs”),
prior(cauchy(0, 3), class = sd, coef = Intercept, group = “obs”),
prior(cauchy(0, 3), class = sd, group = “Structure”),
prior(cauchy(0, 3), class = sd, coef = Intercept, group = “Structure”),
prior(cauchy(0, 3), class = sd, group = “SubjectCode”),
prior(cauchy(0, 3), class = sd, coef = AcquiGen1, group = “SubjectCode”),
prior(cauchy(0, 3), class = sd, coef = Intercept, group = “SubjectCode”),
prior(cauchy(0, 3), class = sd, coef = Probe, group = “SubjectCode”)),
iter = 10000,
inits = “random”,
control = list(adapt_delta = .99),
seed = 12345)

The model runs well and has nice fit statistics, which suggest model convergence.

My question is relative to the pp_check function. I get the following figure and want to verify what it is plotting. The Y axis is the probability of a correct response, and I assume that the x axis is the observation. In the case of my model this is the probe number. This makes sense to me for the baseline model as we would not expect the patient to be improving prior to treatment. However, in the pp_check for the treatment model I get a plot that looks relatively similar, though with more variability given that the patients are now responding to treatment. In either of these cases my confusion arises as to why the patients start at y = 0.5 rather than y = roughly zero probability of a correct response. This confusion, though not for a stan forum to identify what my patients are doing, makes me question if I am actually interpreting the figure the way in which it is supposed to be interpreted!

ppcheck cate.pdf (90.0 KB)

The y-axis is the density of the distribution, which does not make much sense for a response that is actually continuous. I recomend trying out other pp_check types or just manually create predictions via posterior_predict and then summarize/visualize the results yourself.