I am fairly new to using R. Currently, I am trying to estimate posterior crash counts based on prior crash data using Fully Bayes on R. In my data, I have before and after periods crash counts, and additional information on related independent variables for both the before and after periods. I have previously predicted the prior crash frequency based on random effect negative binomial and a screenshot of the sample code is also attached here. As you will see, the first chunk of the code is working fine within “#ORT Random effects for Full Bayes”. However, the posterior estimation is where I am having trouble implementing.
Please help me with the code to estimate the posterior crash counts. Thank you so much for all your help.