Hobbs, B.P. and Carlin, B.P., "Practical Bayesian design and analysis for drug and device clinical trials," J. Biopharmaceutical Statistics , 18, 54-80, 2008.



Application in Drug Trials

The 5 text files below provide code in R and BUGS allowing us to perform Bayesian sample size calculations similar to those done for the NNRTI drug trial in Section 3 of the paper given above by Hobbs and Carlin (2007). Consult Dr. Carlin's BRugs page for instructions on downloading and installing R software and the BRugs package. Then follow these steps:

  • Save each of the text files (below) into the same directory with the same filenames.

    WARNING: DON'T save these files by right-clicking in Explorer; instead, open the file and do "File-Save As", *OR* (better yet) open the file and copy-paste it into a .txt file to ensure proper decoding of carriage returns!!!

  • Launch R and change the working directory appropriately ("Change dir..." under the File menu).
  • Load the BRugs package and source "drug_design.txt" by typing into the R console:
  • To compute empirical probabilities for each of the six decisions in Figure 1 with 160 subjects (per group) and indifference zone boundaries corresponding to phi=0.30, submit to R:
  • Then the list "results" contains empirical probability tables for each model. These can be returned by typing:
  • Also "results" stores all 95% posterior interval limits generated during the simulation. For each of the 3 models and 7 "true" deltas there exists "ITER" credible intervals. These can be returned by typing:
  • R code


    BUGS code


    Application in Device Trials

    The 6 text files below provide code in R and BUGS allowing us to perform Bayesian sample size calculations similar to those done for the LVAD device trial in Section 4 of the paper given above by Hobbs and Carlin (2007). Follow these steps:

  • Save each of the text files (below) into the same directory with the same filenames.

    WARNING: DON'T save these files by right-clicking in Explorer; instead, open the file and do "File-Save As", *OR* (better yet) open the file and copy-paste it into a .txt file to ensure proper decoding of carriage returns!!!

  • Launch R and change the working directory appropriately ("Change dir..." under the File menu).
  • Load the BRugs package, source "device_design.txt" and "create_inits.txt" by typing into the R console:
  • To compute empirical probabilities for each of the six decisions in Figure 1 with interim evaluations after 100, 150, 200, 250, 300 survival events (per group) with "true" delta=0.5 and indifference zone boundaries corresponding to phi=0.50, submit to R:
  • The list "results" contains an empirical probability table for each historical data. These can be returned by typing:
  • R code


    BUGS code