Session Ready
Exercise

Constructing a beta prior

Suppose Rebekah is interested in constructing her prior for P, the proportion of college women who believe they are overweight.

Rebekah decides her prior median is 0.70. This is the value such that the actual proportion P is equally likely to be smaller or larger than it.

Next, she decides the 90th percentile is 0.85. This is the value such that she is 90% sure P is smaller than it.

You can use the beta.select() function to find the vector of shape parameters of the beta curve which best matches the two quantiles outlined above!

quantile1 <- list(p = 0.5, x = 0.70)
quantile2 <- list(p = 0.9, x = 0.85)
beta.select(quantile1, quantile2)
Instructions
100 XP

Suppose Greg is constructing his prior for P. Greg specifies his 0.25 quantile to be 0.70, and his 0.75 quantile to be 0.85.

  • Specify a list of values p and x for Greg's first quantile.
  • Specify a list of values p and x for Greg's second quantile.
  • Use the beta.select() function to find the vector of beta parameters. Save the result to ab.
  • Pass ab to the beta_draw() function to plot Greg's prior curve.