Exercise

Highest Posterior Density credible intervals

You know that reporting bare point estimates is not enough. It would be great to provide a measure of uncertainty in the drug's efficacy rate estimate, and you have all the means to do so. You decide to add the following to the memo.

The experimental results indicate that with a 90% probability the new drug's efficacy rate is between ___ and ___, and with a 95% probability it is between ___ and ___.

You will need to calculate two credible intervals: one of 90% and another of 95% probability. The drug_efficacy_posterior_draws array is still available in your workspace.

Instructions

100 XP
  • Import the arviz package as az.
  • Calculate the Highest Posterior Density credible interval of 90% and assign it to ci_90.
  • Calculate the Highest Posterior Density credible interval of 95% and assign it to ci_95.