Session Ready
Exercise

Posterior probabilities

You've used RJAGS output to explore and quantify the posterior trend & uncertainty \(b\). You can also use RJAGS output to assess specific hypotheses. For example: What's the posterior probability that, on average, weight increases by more than 1.1 kg for every 1 cm increase in height? That is, what's the posterior probability that \(b > 1.1\)?

You will approximate this probability by the proportion of \(b\) Markov chain values that exceed 1.1. The weight_chains data frame with the 100,000 iteration Markov chain output is in your workspace.

Instructions
100 XP
  • Construct a density plot of the \(b\) Markov chain values and use geom_vline() to superimpose a vertical line at 1.1.
  • Use table() to summarize the number of \(b\) Markov chain values that exceed 1.1.
  • Use mean() to calculate the proportion of \(b\) Markov chain values that exceed 1.1.