Approach to estimating contrasts using brms model

Hello all,

I’m new to bayesian regression, and am using a negative binomial regression model to model some count data. The goal of the model is to predict response count to images based on subject lesion status (0 or 1) and image presentation number (1 through 4), while accounting for random image and nested subject effects:

fit_default_negbinomial <- brm(
  nresponses ~ lesion * presnum + (1 | lesion:Subject) + (1 | imageID),
  data = CDS_filtered,
  family = negbinomial,
  prior = c(
    prior(normal(0,5), class = "Intercept"),
    prior(normal(0,1), class = "b") 
  ),
  chains = 4,
  cores = 4,
  iter = 4000,
  control = list(adapt_delta = 0.95),
  seed = 1
  )

I want to test whether the average percent decrease in touch count between the first and xth (2-4) presentation is different between lesioned and non-lesioned groups. As such, I used posterior_epred, which to my understanding returns the expected value of the posterior predictive distribution at each point specified in the “new data” argument.

newdata <- expand_grid(
  lesion = c(0, 1),
  presnum = factor(c(1, 2, 3, 4)),
)

pred_marg <- posterior_epred(fit_default_negbinomial, newdata = newdata, re_formula = NA)

I then used this to calculate the expected percent decrease from baseline for lesion and non lesion groups, and the posterior difference between groups.

pred_marg <- posterior_epred(fit_default_negbinomial, newdata = newdata, re_formula = NA)

ctrl_base <- pred_marg[, 1]  
lesion_base <- pred_marg[, 5]  

pct_change_marg <- tibble(
  C_12 = 100 * (pred_marg[, 2] - ctrl_base) / ctrl_base,
  C_13 = 100 * (pred_marg[, 3] - ctrl_base) / ctrl_base,
  C_14 = 100 * (pred_marg[, 4] - ctrl_base) / ctrl_base,
  L_12 = 100 * (pred_marg[, 6] - lesion_base) / lesion_base,
  L_13 = 100 * (pred_marg[, 7] - lesion_base) / lesion_base,
  L_14 = 100 * (pred_marg[, 8] - lesion_base) / lesion_base
)

diff_pct_change <- tibble(
  Diff_12 = pct_change_marg$C_12 - pct_change_marg$L_12,
  Diff_13 = pct_change_marg$C_13 - pct_change_marg$L_13,
  Diff_14 = pct_change_marg$C_14 - pct_change_marg$L_14
)

The current reading I have done seems to point to this being a valid approach to answering my research question. However, I am new to these methods and wanted to ask whether this approach makes sense.