Introduction

This vignette describes how to use the tidybayes package to extract tidy data frames of draws from posterior distributions of model variables, fits, and predictions from rstanarm. For a more general introduction to tidybayes and its use on general-purpose Bayesian modeling languages (like Stan and JAGS), see vignette(“tidybayes”).

Example dataset

To demonstrate tidybayes, we will use a simple dataset with 10 observations from 5 conditions each:

A snapshot of the data looks like this:

## # A tibble: 10 x 2
##    condition response
##    <chr>        <dbl>
##  1 A           -0.420
##  2 B            1.69 
##  3 C            1.37 
##  4 D            1.04 
##  5 E           -0.144
##  6 A           -0.301
##  7 B            0.764
##  8 C            1.68 
##  9 D            0.857
## 10 E           -0.931

This is a typical tidy format data frame: one observation per row. Graphically:

Model

Let’s fit a hierarchical model with shrinkage towards a global mean:

The results look like this:

## stan_lmer
##  family:       gaussian [identity]
##  formula:      response ~ (1 | condition)
##  observations: 50
## ------
##             Median MAD_SD
## (Intercept) 0.7    0.5   
## sigma       0.6    0.1   
## 
## Error terms:
##  Groups    Name        Std.Dev.
##  condition (Intercept) 1.13    
##  Residual              0.57    
## Num. levels: condition 5 
## 
## Sample avg. posterior predictive distribution of y:
##          Median MAD_SD
## mean_PPD 0.6    0.1   
## 
## ------
## For info on the priors used see help('prior_summary.stanreg').

Extracting draws from a fit in tidy-format using spread_draws

Now that we have our results, the fun begins: getting the draws out in a tidy format! First, we’ll use the get_variables function to get a list of raw model variables names so that we know what variables we can extract from the model:

##  [1] "(Intercept)"                              "b[(Intercept) condition:A]"              
##  [3] "b[(Intercept) condition:B]"               "b[(Intercept) condition:C]"              
##  [5] "b[(Intercept) condition:D]"               "b[(Intercept) condition:E]"              
##  [7] "sigma"                                    "Sigma[condition:(Intercept),(Intercept)]"
##  [9] "accept_stat__"                            "stepsize__"                              
## [11] "treedepth__"                              "n_leapfrog__"                            
## [13] "divergent__"                              "energy__"

Here, (Intercept) is the global mean, and the b parameters are offsets from that mean for each condition. Given these parameters:

  • b[(Intercept) condition:A]
  • b[(Intercept) condition:B]
  • b[(Intercept) condition:C]
  • b[(Intercept) condition:D]
  • b[(Intercept) condition:E]

We might want a data frame where each row is a draw from either b[(Intercept) condition:A], b[(Intercept) condition:B], ...:C], ...:D], or ...:E], and where we have columns indexing which chain/iteration/draw the row came from and which condition (A to E) it is for. That would allow us to easily compute quantities grouped by condition, or generate plots by condition using ggplot, or even merge draws with the original data to plot data and posteriors.

The workhorse of tidybayes is the spread_draws function, which does this extraction for us. It includes a simple specification format that we can use to extract model variables and their indices into tidy-format data frames.

Gathering variable indices into a separate column in a tidy format data frame

Given a parameter like this:

b[(Intercept) condition:D]

We can provide spread_draws with a column specification like this:

b[term,group]

Where term corresponds to (Intercept) and group to condition:D. There is nothing too magical about what spread_draws does with this specification: under the hood, it splits the parameter indices by commas and spaces (you can split by other characters by changing the sep argument). It lets you assign columns to the resulting indices in order. So b[(Intercept) condition:D] has indices (Intercept) and condition:D, and spread_draws lets us extract these indices as columns in the resulting tidy data frame of draws from b:

m %>%
  spread_draws(b[term,group]) %>%
  head(10)
## # A tibble: 10 x 6
## # Groups:   term, group [5]
##    .chain .iteration .draw term        group            b
##     <int>      <int> <int> <chr>       <chr>        <dbl>
##  1      1          1     1 (Intercept) condition:A -0.886
##  2      1          1     1 (Intercept) condition:B  0.123
##  3      1          1     1 (Intercept) condition:C  0.821
##  4      1          1     1 (Intercept) condition:D -0.214
##  5      1          1     1 (Intercept) condition:E -2.06 
##  6      1          2     2 (Intercept) condition:A -0.386
##  7      1          2     2 (Intercept) condition:B  0.179
##  8      1          2     2 (Intercept) condition:C  0.862
##  9      1          2     2 (Intercept) condition:D -0.328
## 10      1          2     2 (Intercept) condition:E -1.76

We can choose whatever names we want for the index columns; e.g.:

## # A tibble: 10 x 6
## # Groups:   t, g [5]
##    .chain .iteration .draw t           g                b
##     <int>      <int> <int> <chr>       <chr>        <dbl>
##  1      1          1     1 (Intercept) condition:A -0.886
##  2      1          1     1 (Intercept) condition:B  0.123
##  3      1          1     1 (Intercept) condition:C  0.821
##  4      1          1     1 (Intercept) condition:D -0.214
##  5      1          1     1 (Intercept) condition:E -2.06 
##  6      1          2     2 (Intercept) condition:A -0.386
##  7      1          2     2 (Intercept) condition:B  0.179
##  8      1          2     2 (Intercept) condition:C  0.862
##  9      1          2     2 (Intercept) condition:D -0.328
## 10      1          2     2 (Intercept) condition:E -1.76

But the more descriptive and less cryptic names from the previous example are probably preferable.

In this particular model, there is only one term ((Intercept)), thus we could omit that index altogether to just get each group and the value of b for the corresponding condition:

## # A tibble: 10 x 5
## # Groups:   group [5]
##    .chain .iteration .draw group            b
##     <int>      <int> <int> <chr>        <dbl>
##  1      1          1     1 condition:A -0.886
##  2      1          1     1 condition:B  0.123
##  3      1          1     1 condition:C  0.821
##  4      1          1     1 condition:D -0.214
##  5      1          1     1 condition:E -2.06 
##  6      1          2     2 condition:A -0.386
##  7      1          2     2 condition:B  0.179
##  8      1          2     2 condition:C  0.862
##  9      1          2     2 condition:D -0.328
## 10      1          2     2 condition:E -1.76

Since all the groups in this case are from the condition factor, we may also want to separate out a column just containing the corresponding condition (A, B, C, etc). We can do that using tidyr::separate:

## # A tibble: 10 x 6
##    .chain .iteration .draw group     condition      b
##     <int>      <int> <int> <chr>     <chr>      <dbl>
##  1      1          1     1 condition A         -0.886
##  2      1          1     1 condition B          0.123
##  3      1          1     1 condition C          0.821
##  4      1          1     1 condition D         -0.214
##  5      1          1     1 condition E         -2.06 
##  6      1          2     2 condition A         -0.386
##  7      1          2     2 condition B          0.179
##  8      1          2     2 condition C          0.862
##  9      1          2     2 condition D         -0.328
## 10      1          2     2 condition E         -1.76

Alternatively, we could change the sep argument to spread_draws to also split on : (sep is a regular expression). Note: This works in this example, but will not work well on rstanarm models where interactions between factors are used as grouping levels in a multilevel model, thus : is not included in the default separators.

m %>% 
  spread_draws(b[,group,condition], sep = "[, :]") %>%
  head(10)
## # A tibble: 10 x 6
## # Groups:   group, condition [5]
##    .chain .iteration .draw group     condition      b
##     <int>      <int> <int> <chr>     <chr>      <dbl>
##  1      1          1     1 condition A         -0.886
##  2      1          1     1 condition B          0.123
##  3      1          1     1 condition C          0.821
##  4      1          1     1 condition D         -0.214
##  5      1          1     1 condition E         -2.06 
##  6      1          2     2 condition A         -0.386
##  7      1          2     2 condition B          0.179
##  8      1          2     2 condition C          0.862
##  9      1          2     2 condition D         -0.328
## 10      1          2     2 condition E         -1.76

Note: If you have used spread_draws with a raw sample from Stan or JAGS, you may be used to using recover_types before spread_draws to get index column values back (e.g. if the index was a factor). This is not necessary when using spread_draws on rstanarm models, because those models already contain that information in their variable names. For more on recover_types, see vignette(“tidybayes”).

Point summaries and intervals

With simple model variables

tidybayes provides a family of functions for generating point summaries and intervals from draws in a tidy format. These functions follow the naming scheme [median|mean|mode]_[qi|hdi], for example, median_qi, mean_qi, mode_hdi, and so on. The first name (before the _) indicates the type of point summary, and the second name indicates the type of interval. qi yields a quantile interval (a.k.a. equi-tailed interval, central interval, or percentile interval) and hdi yields a highest (posterior) density interval. Custom point or interval functions can also be applied using the point_interval function.

For example, we might extract the draws corresponding to the posterior distributions of the overall mean and standard deviation of observations:

m %>%
  spread_draws(`(Intercept)`, sigma) %>%
  head(10)
## # A tibble: 10 x 5
##    .chain .iteration .draw `(Intercept)` sigma
##     <int>      <int> <int>         <dbl> <dbl>
##  1      1          1     1         0.982 0.621
##  2      1          2     2         0.930 0.590
##  3      1          3     3         0.842 0.608
##  4      1          4     4         0.908 0.605
##  5      1          5     5         0.449 0.499
##  6      1          6     6         0.469 0.491
##  7      1          7     7         0.775 0.485
##  8      1          8     8         0.417 0.518
##  9      1          9     9         0.786 0.533
## 10      1         10    10         1.07  0.490

Like with b[term,group], this gives us a tidy data frame. If we want the median and 95% quantile interval of the variables, we can apply median_qi:

m %>%
  spread_draws(`(Intercept)`, sigma) %>%
  median_qi(`(Intercept)`, sigma)
## # A tibble: 1 x 9
##   `(Intercept)` `(Intercept).lower` `(Intercept).upper` sigma sigma.lower sigma.upper .width .point .interval
##           <dbl>               <dbl>               <dbl> <dbl>       <dbl>       <dbl>  <dbl> <chr>  <chr>    
## 1         0.650              -0.368                1.73 0.562       0.460       0.695   0.95 median qi

We can specify the columns we want to get medians and intervals from, as above, or if we omit the list of columns, median_qi will use every column that is not a grouping column or a special column (like .chain, .iteration, or .draw). Thus in the above example, (Intercept) and sigma are redundant arguments to median_qi because they are also the only columns we gathered from the model. So we can simplify this to:

m %>%
  spread_draws(`(Intercept)`, sigma) %>%
  median_qi()
## # A tibble: 1 x 9
##   `(Intercept)` `(Intercept).lower` `(Intercept).upper` sigma sigma.lower sigma.upper .width .point .interval
##           <dbl>               <dbl>               <dbl> <dbl>       <dbl>       <dbl>  <dbl> <chr>  <chr>    
## 1         0.650              -0.368                1.73 0.562       0.460       0.695   0.95 median qi

If you would rather have a long-format list of intervals, use gather_draws instead:

m %>%
  gather_draws(`(Intercept)`, sigma) %>%
  median_qi()
## # A tibble: 2 x 7
##   .variable   .value .lower .upper .width .point .interval
##   <chr>        <dbl>  <dbl>  <dbl>  <dbl> <chr>  <chr>    
## 1 (Intercept)  0.650 -0.368  1.73    0.95 median qi       
## 2 sigma        0.562  0.460  0.695   0.95 median qi

For more on gather_draws, see vignette(“tidybayes”).

With indexed variables

When we have a model variable with one or more indices, such as b, we can apply median_qi (or other functions in the point_interval family) as we did before:

## # A tibble: 5 x 7
##   group            b .lower .upper .width .point .interval
##   <chr>        <dbl>  <dbl>  <dbl>  <dbl> <chr>  <chr>    
## 1 condition:A -0.441 -1.53   0.595   0.95 median qi       
## 2 condition:B  0.354 -0.707  1.37    0.95 median qi       
## 3 condition:C  1.18   0.106  2.22    0.95 median qi       
## 4 condition:D  0.374 -0.713  1.42    0.95 median qi       
## 5 condition:E -1.52  -2.66  -0.493   0.95 median qi

How did median_qi know what to aggregate? Data frames returned by spread_draws are automatically grouped by all index variables you pass to it; in this case, that means spread_draws groups its results by group. median_qi respects those groups, and calculates the point summaries and intervals within all groups. Then, because no columns were passed to median_qi, it acts on the only non-special (.-prefixed) and non-group column, b. So the above shortened syntax is equivalent to this more verbose call:

m %>%
  spread_draws(b[,group]) %>%
  group_by(group) %>%       # this line not necessary (done by spread_draws)
  median_qi(b)                # b is not necessary (it is the only non-group column)
## # A tibble: 5 x 7
##   group            b .lower .upper .width .point .interval
##   <chr>        <dbl>  <dbl>  <dbl>  <dbl> <chr>  <chr>    
## 1 condition:A -0.441 -1.53   0.595   0.95 median qi       
## 2 condition:B  0.354 -0.707  1.37    0.95 median qi       
## 3 condition:C  1.18   0.106  2.22    0.95 median qi       
## 4 condition:D  0.374 -0.713  1.42    0.95 median qi       
## 5 condition:E -1.52  -2.66  -0.493   0.95 median qi

Combining variables with different indices in a single tidy format data frame

spread_draws and gather_draws support extracting variables that have different indices into the same data frame. Indices with the same name are automatically matched up, and values are duplicated as necessary to produce one row per all combination of levels of all indices. For example, we might want to calculate the mean within each condition (call this condition_mean). In this model, that mean is the intercept ((Intercept)) plus the effect for a given condition (b).

We can gather draws from (Intercept) and b together in a single data frame:

m %>% 
  spread_draws(`(Intercept)`, b[,group]) %>%
  head(10)
## # A tibble: 10 x 6
## # Groups:   group [5]
##    .chain .iteration .draw `(Intercept)` group            b
##     <int>      <int> <int>         <dbl> <chr>        <dbl>
##  1      1          1     1         0.982 condition:A -0.886
##  2      1          1     1         0.982 condition:B  0.123
##  3      1          1     1         0.982 condition:C  0.821
##  4      1          1     1         0.982 condition:D -0.214
##  5      1          1     1         0.982 condition:E -2.06 
##  6      1          2     2         0.930 condition:A -0.386
##  7      1          2     2         0.930 condition:B  0.179
##  8      1          2     2         0.930 condition:C  0.862
##  9      1          2     2         0.930 condition:D -0.328
## 10      1          2     2         0.930 condition:E -1.76

Within each draw, (Intercept) is repeated as necessary to correspond to every index of b. Thus, the mutate function from dplyr can be used to find their sum, condition_mean (which is the mean for each condition):

## # A tibble: 5 x 7
##   group       condition_mean .lower .upper .width .point .interval
##   <chr>                <dbl>  <dbl>  <dbl>  <dbl> <chr>  <chr>    
## 1 condition:A          0.202 -0.150  0.549   0.95 median qi       
## 2 condition:B          0.998  0.644  1.35    0.95 median qi       
## 3 condition:C          1.83   1.47   2.20    0.95 median qi       
## 4 condition:D          1.02   0.664  1.37    0.95 median qi       
## 5 condition:E         -0.876 -1.24  -0.512   0.95 median qi

median_qi uses tidy evaluation (see vignette("tidy-evaluation", package = "rlang")), so it can take column expressions, not just column names. Thus, we can simplify the above example by moving the calculation of condition_mean from mutate into median_qi:

m %>%
  spread_draws(`(Intercept)`, b[,group]) %>%
  median_qi(condition_mean = `(Intercept)` + b)
## # A tibble: 5 x 7
##   group       condition_mean .lower .upper .width .point .interval
##   <chr>                <dbl>  <dbl>  <dbl>  <dbl> <chr>  <chr>    
## 1 condition:A          0.202 -0.150  0.549   0.95 median qi       
## 2 condition:B          0.998  0.644  1.35    0.95 median qi       
## 3 condition:C          1.83   1.47   2.20    0.95 median qi       
## 4 condition:D          1.02   0.664  1.37    0.95 median qi       
## 5 condition:E         -0.876 -1.24  -0.512   0.95 median qi

Plotting points and intervals

Plotting point summaries and with one interval is straightforward using the ggplot2::geom_pointrange or ggstance::geom_pointrangeh geoms:

Intervals with multiple probability levels

median_qi and its sister functions can also produce an arbitrary number of probability intervals by setting the .width = argument:

m %>%
  spread_draws(`(Intercept)`, b[,group]) %>%
  median_qi(condition_mean = `(Intercept)` + b, .width = c(.95, .8, .5))
## # A tibble: 15 x 7
##    group       condition_mean  .lower .upper .width .point .interval
##    <chr>                <dbl>   <dbl>  <dbl>  <dbl> <chr>  <chr>    
##  1 condition:A          0.202 -0.150   0.549   0.95 median qi       
##  2 condition:B          0.998  0.644   1.35    0.95 median qi       
##  3 condition:C          1.83   1.47    2.20    0.95 median qi       
##  4 condition:D          1.02   0.664   1.37    0.95 median qi       
##  5 condition:E         -0.876 -1.24   -0.512   0.95 median qi       
##  6 condition:A          0.202 -0.0311  0.425   0.8  median qi       
##  7 condition:B          0.998  0.779   1.23    0.8  median qi       
##  8 condition:C          1.83   1.60    2.06    0.8  median qi       
##  9 condition:D          1.02   0.787   1.24    0.8  median qi       
## 10 condition:E         -0.876 -1.11   -0.646   0.8  median qi       
## 11 condition:A          0.202  0.0807  0.316   0.5  median qi       
## 12 condition:B          0.998  0.879   1.12    0.5  median qi       
## 13 condition:C          1.83   1.71    1.95    0.5  median qi       
## 14 condition:D          1.02   0.899   1.13    0.5  median qi       
## 15 condition:E         -0.876 -0.999  -0.754   0.5  median qi

The results are in a tidy format: one row per group and uncertainty interval width (.width). This facilitates plotting. For example, assigning -.width to the size aesthetic will show all intervals, making thicker lines correspond to smaller intervals. The geom_pointintervalh geom, provided by tidybayes, is a shorthand for a geom_pointrangeh with xmin, xmax, and size set appropriately based on the .lower, .upper, and .width columns in the data to produce plots of points with multiple probability levels:

m %>%
  spread_draws(`(Intercept)`, b[,group]) %>%
  median_qi(condition_mean = `(Intercept)` + b, .width = c(.95, .66)) %>%
  ggplot(aes(y = group, x = condition_mean)) +
  geom_pointintervalh() 

Intervals with densities

To see the density along with the intervals, we can use geom_eyeh (horizontal “eye plots”, which combine intervals with violin plots), or geom_halfeyeh (horizontal interval + density plots):

Posterior fits

Rather than calculating conditional means manually as in the previous example, we could use add_fitted_draws, which is analogous to rstanarm::posterior_linpred (giving posterior draws from the model’s linear predictor, in this case, posterior distributions of conditional means), but uses a tidy data format. We can combine it with modelr::data_grid to first generate a grid describing the fits we want, then transform that grid into a long-format data frame of draws from posterior fits:

## # A tibble: 10 x 6
## # Groups:   condition, .row [1]
##    condition  .row .chain .iteration .draw  .value
##    <chr>     <int>  <int>      <int> <int>   <dbl>
##  1 A             1     NA         NA     1  0.0959
##  2 A             1     NA         NA     2  0.545 
##  3 A             1     NA         NA     3  0.279 
##  4 A             1     NA         NA     4  0.223 
##  5 A             1     NA         NA     5  0.153 
##  6 A             1     NA         NA     6  0.0941
##  7 A             1     NA         NA     7  0.183 
##  8 A             1     NA         NA     8  0.334 
##  9 A             1     NA         NA     9  0.457 
## 10 A             1     NA         NA    10 -0.0262

To plot this example, we’ll also show the use of stat_pointintervalh instead of geom_pointintervalh, which summarizes draws into point summaries and intervals within ggplot:

Quantile dotplots

Intervals are nice if the alpha level happens to line up with whatever decision you are trying to make, but getting a shape of the posterior is better (hence eye plots, above). On the other hand, making inferences from density plots is imprecise (estimating the area of one shape as a proportion of another is a hard perceptual task). Reasoning about probability in frequency formats is easier, motivating quantile dotplots, which also allow precise estimation of arbitrary intervals (down to the dot resolution of the plot, here 100):

The idea is to get away from thinking about the posterior as indicating one canonical point or interval, but instead to represent it as (say) 100 approximately equally likely points.

Posterior predictions

Where add_fitted_draws is analogous to rstanarm::posterior_linpred, add_predicted_draws is analogous to rstanarm::posterior_predict, giving draws from the posterior predictive distribution.

Here is an example of posterior predictive distributions plotted using ggridges::geom_density_ridges:

## Picking joint bandwidth of 0.1

We could also use tidybayes::stat_intervalh to plot predictive bands alongside the data:

Altogether, data, posterior predictions, and posterior distributions of the means:

Fit/prediction curves

To demonstrate drawing fit curves with uncertainty, let’s fit a slightly naive model to part of the mtcars dataset:

We can plot fit curves with probability bands:

Or we can sample a reasonable number of fit lines (say 100) and overplot them:

Or, for posterior predictions (instead of fits), we can go back to probability bands:

This can get difficult to judge by group, so could be better to facet into multiple plots. Fortunately, since we are using ggplot, that functionality is built in:

Comparing levels of a factor

If we wish compare the means from each condition, compare_levels facilitates comparisons of the value of some variable across levels of a factor. By default it computes all pairwise differences.

Let’s demonstrate compare_levels with another plotting geom, geom_halfeyeh, which gives horizontal “half-eye” plots, combining intervals with a density plot:

If you prefer “caterpillar” plots, ordered by something like the mean of the difference, you can reorder the factor before plotting:

Ordinal models

Ordinal model with categorical predictor

Here’s an ordinal model with a categorical predictor:

The rstanarm::posterior_linpred function for ordinal regression models in rstanarm returns only the link-level prediction for each draw (in contrast to brms::fitted.brmsfit, which returns one prediction per category for ordinal models, see the ordinal regression examples in vignette("tidy-brms")). The philosophy of tidybayes is to tidy whatever format is output by a model, so in keeping with that philosophy, when applied to ordinal rstanarm models, add_fitted_draws just returns the link-level prediction (Note: setting scale = "response" for such models will not usually make sense).

For example, here is a plot of the link-level fit:

This can be hard to interpret. To turn this into predicted probabilities on a per-category basis, we have to use the fact that an ordinal logistic regression defines the probability of an outcome in category \(j\) or less as:

\[ \textrm{logit}\left[Pr(Y\le j)\right] = \alpha_j - \beta x \]

Thus, the probability of category \(j\) is:

\[ \begin{align} Pr(Y = j) &= Pr(Y \le j) - Pr(Y \le j - 1)\\ &= \textrm{logit}^{-1}(\alpha_j - \beta x) - \textrm{logit}^{-1}(\alpha_{j-1} - \beta x) \end{align} \]

To derive these values, we need two things:

  • The \(\alpha_j\) values. These are threshold parameters fitted by the model. For convenience, if there are \(k\) levels, we will take \(\alpha_k = +\infty\), since the probability of being in the top level or below it is 1.

  • The \(\beta x\) values. These are just the .value column returned by add_fitted_draws.

The thresholds in rstanarm are coefficients with names containing |, indicating which categories they are thresholds between. We can see those parameters in the list of variables in the model:

get_variables(m_esoph_rs)
##  [1] "agegp.L"        "agegp.Q"        "agegp.C"        "agegp^4"        "agegp^5"        "0-9g/day|10-19"
##  [7] "10-19|20-29"    "20-29|30+"      "accept_stat__"  "stepsize__"     "treedepth__"    "n_leapfrog__"  
## [13] "divergent__"    "energy__"

We can extract those automatically by using the regex = TRUE argument to gather_draws to find all variables containing a | character. We will then use summarise_all(list) to turn these thresholds into a list column, and add a final threshold equal to \(+\infty\) (to represent the highest category):

## # A tibble: 10 x 2
##    .draw threshold
##    <int> <list>   
##  1     1 <dbl [4]>
##  2     2 <dbl [4]>
##  3     3 <dbl [4]>
##  4     4 <dbl [4]>
##  5     5 <dbl [4]>
##  6     6 <dbl [4]>
##  7     7 <dbl [4]>
##  8     8 <dbl [4]>
##  9     9 <dbl [4]>
## 10    10 <dbl [4]>

For example, the threshold vector from one row of this data frame (i.e., from one draw from the posterior) looks like this:

## [[1]]
## [1] -1.133867  0.405685  1.265827       Inf

We can combine those thresholds (the \(\alpha_j\) values from the above formula) with the .value from add_fitted_draws (\(\beta x\) from the above formula) to calculate per-category probabilities:

It is hard to see the changes in categories in the above plot; let’s try something that gives a better gist of the distribution within each year:

This output should be very similar to the output from the corresponding m_esoph_brm model in vignette("tidy-brms") (modulo different priors), though it takes a bit more work to produce in rstanarm compared to brms.