Three-Level-Meta-Analyis in brms: "Error evaluating the log probability at the initial value."

Hi everybody,
I’m really new in R-/Stan-coding and want to conduct a Three-Level-Meta-Analysis in brms. But there is the following error in:

“Chain 1: Rejecting initial value:
Chain 1: Error evaluating the log probability at the initial value.
Chain 1: Exception: normal_lpdf: Scale parameter[3] is 0, but must be > 0! (in ‘model2f243c61550a_bcf717c53c8e740f935e13413bc27e34’ at line 48)”


```# set priors

priors <- c(prior(normal(0, .5), class = Intercept),
            prior(cauchy(0, .5), class = sd))
            
# fit three-level-model

fit_sbi <- brm(r |se(SE) ~ 1 + (1|Study_ID/ES_ID),
               data = dataset,
               prior = priors, 
               iter = 4000,
               warmup = 2000)


Data are structured as follows:
![Data_Meta-Analysis|690x392](upload://f2uXseSoL5PZd6RUOeaiGpglOhL.jpeg)

Please also provide the following information in addition to your question: 

* Operating System: Windows 10, 64 bit
* brms Version: 2. 16.2

Thank you so much for your help!
Kind regards, 
Hanna

I might help if you tell us a little more about your r data. How many cases do you have and what’s the mean and standard deviation of the r distribution?

Hi,
the data contain 40 correlation coefficients nested in 13 studies. Mean r = .35 (SD = .25). Some effect sizes are r = 0 and therefore SE = 0. I think this could be the problem. Therefore I chose sample sizes for weights, the new code looks like this:

priors ← c(prior(normal(0, .5), class = Intercept),
prior(cauchy(0, .5), class = sd))

fit_sbi ← brm(r |weights (N) ~ 1 + (1|Study_ID/ES_ID),
data = dataset,
prior = priors,
iter = 4000,
warmup = 2000,
control = list(max_treedepth = 12,
adapt_delta = .999)).

The actual problem is that Rhat values are too large and the model does not converge.
Thank you so much for your help!

That info is helpful. It’s not clear, to me, why an r = 0 should also have an se = 0. I suspect that’s the origins of your problem. That aside, you might tighten up your second prior to prior(normal(0, .5), class = sd).