Translating unit-scale expectations into shifted lognormal priors

Hi there! I’d like to run a simple brms model that assumes a shifted lognormal response distribution. I was hoping to get confirmation that I’m correctly translating my raw (RT) unit expectations into specific, log-scaled priors.

I’m investigating a 2x2 interaction of the form “RT ~ A *B.” A previous paper ran a frequentist model that returns the following coefficient estimates.

prev_study_rt_intercept <- .5
prev_study_rt_intercept_sd <- .4

prev_study_rt_cond_A <- .2
prev_study_rt_cond_A_sd <- .15

prev_study_rt_cond_B <- .03
prev_study_rt_cond_B_sd <- .1

prev_study_rt_A_x_B <- -.04
prev_study_rt_A_x_B_sd <- .06

If I, too, wanted to run an “RT ~ A * B” model, but doing so on new data, in brms, and using a shifted lognormal distribution, would the following code correctly set my priors in line with the findings from the previous study? I’m particularly unsure about whether I’m setting the priors on the sd’s correctly. I used abs to ensure the sd is positive, but the fact that it’s even needed tells me that I might be off.

expected_ndt_shift <- 200

prior_intercept  <- log(prev_study_rt_intercept - expected_ndt_shift)
prior_intercept_sd  <- abs(log(prev_study_rt_intercept_sd))

prior_cond_A  <- log(1 + prev_study_rt_cond_A / prev_study_rt_intercept)
prior_cond_A_sd  <- abs(log(1 + prev_study_rt_cond_A_sd / prev_study_rt_intercept))

prior_cond_B  <- log(1 + prev_study_rt_cond_B / prev_study_rt_intercept)
prior_cond_B_sd  <- abs(log(1 + prev_study_rt_cond_B_sd / prev_study_rt_intercept))

prior_cond_A_x_B  <- log(1 + prev_study_rt_cond_A_x_B / prev_study_rt_intercept)
prior_cond_A_x_B_sd  <- abs(log(1 + prev_study_rt_cond_A_x_B_sd / prev_study_rt_intercept))


my_priors = c(
  set_prior(paste0('normal(', prior_intercept, ', ', prior_intercept_sd, ')'), class = 'Intercept'),
  set_prior(paste0('normal(', prior_cond_A, ', ', prior_cond_A_sd, ')'), class = 'b', coef = 'A'),
  set_prior(paste0('normal(', prior_cond_B, ', ', prior_cond_B_sd, ')'), class = 'b', coef = 'B'),
  set_prior(paste0('normal(', prior_cond_A_x_B, ', ', prior_cond_A_x_B_sd, ')'), class = 'b', coef = 'A_x_B'),
)

brm(RT ~ A*B, df, shifted_lognormal(), my_priors)

Thanks in advance!

1 Like

So generally speaking, setting informative priors on the basis of a previously published frequentist analysis is controversial (that’s putting it lightly) in most fields because of publication bias. The preferred approach to deriving an informative prior would be to use a meta-analysis of a range of previous experimental studies that can quantify and correct for this bias to some degree but that can be undertaking in and of itself. This recent paper discusses a slightly different approach, but again you need multiple studies from which to derive a prior distribution.

That being said, you can try sampling from the prior distribution and checking the coverage by specifying sample_prior = "only" in your brm function.

1 Like

Gotcha, thanks! I tried the sample_prior = only approach and the results were still difficult to interpret. Ultimately I ran the model without a prior and compared the fit to what I was already getting with the priors, since the priors appeared to make little difference, and doing so confirmed that my priors were in the same ballpark of units as the posterior.