Exercise

A discrete prior

Suppose a company markets a drug \(S\) (standard), for relieving pain. A new drug \(N\) (new) is developed which may be more effective in relieving pain.

The company plans on designing a clinical trial to compare the effectiveness of the two drugs.

Let pS and pN denote the respective probabilities of being relieved.

The company thinks there are three possibilities:

  • pS > pN (the standard drug is superior)
  • pS = pN (the two drugs are equivalent)
  • pS < pN (the new drug is superior)

In constructing a prior for (pS, pN), the company thinks that probability of relief values of 0.5, 0.6, 0.7, 0.8, and 0.9 are plausible for each drug. In addition, they believe that the chance the two drugs are equivalent is 0.5.

The testing_prior() function constructs a "testing prior" reflecting this information—the inputs indicate each proportion takes on 5 values from 0.5 to 0.9 and the probability pS = pN is 0.5.

prior <- testing_prior(0.5, 0.9, 5, pequal = 0.5)

The draw_two_p() function with prior as an argument produces the graph shown on the right.

Now it's your turn to consider an alternative uniform prior distribution for (pS, pN)!

Instructions

100 XP
  • Suppose instead that each probability can take one of the five values 0.1, 0.3, 0.5, 0.7, 0.9 and all possible (pS, pN) pairs are equally likely. Use the testing_prior() function with inputs 0.1, 0.9, 5, and uniform = TRUE to construct this prior prior.
  • Display the prior matrix.
  • Use draw_two_p() to graph this prior.
  • This prior implies a prior distribution on the difference in probabilities d_NS = pN - pS. Use two_p_summarize() with input prior to find the prior distribution on d_NS, and prob_plot() to graph this distribution.