Model
m = brm(bf(acute_therapy ~ year_centered + (1 | town)), data = data, family = hurdle_lognormal(), cores = 3, chains = 3)
Conditional effects plot for lognormal part of the hurdle model
conditional_effects(m, robust = TRUE)
Comment: all median values are below 2.0 on y-axis
Let’s calculate the median value and CIs for the year 0
m %>% spread_draws(b_Intercept) %>% median_qi(intercept = exp(b_Intercept))
2.05 [1.87; 2.26]
Comment: median value is above 2, not matching the conditional effects plot
The same happens, when I calculate means instead of medians, using formula as follows:
exp((b_Intercept) + 1/2 * (sigma)**2)
What am I doing wrong here and why there is a discrepancy between the two outcomes?
Or are there better options for making such calculations. E.g. calculation mean Y value in year “-4” and in year “4”? I checked fitted() and predict() function, however, did not understand how to receive predictions for year “-4” for example (including all towns).