The crmReporter package is designed to provide a simple interface between crmPack (and other MCMC packages) and the tidyverse and to augment the reporting facilities provided by crmPack, coda, runjags and other packages relating to MCMC simulation.
crmReporter is available from GitHub. To install it, use
devtools::install_github("PuzzledFace/crmReporter")Creating tidy data with crmReporter is simple: use the tidy() verb. Tidy works with mcmcs, mcmc.lists, runjagss and runjags.lists.
library(crmReporter)
#> Registered S3 method overwritten by 'crmPack':
#> method from
#> print.gtable gtable
data("oCRMPosteriorShort")
x <- oCRMPosteriorShort %>% tidy()
x %>% head()
#> # A tibble: 6 x 5
#> Chain Sample Parameter Index Value
#> <int> <chr> <chr> <int> <dbl>
#> 1 1 5001 alpha 1 7.27
#> 2 1 5001 alpha 2 3.10
#> 3 1 5001 beta NA 0.959
#> 4 1 5003 alpha 1 5.73
#> 5 1 5003 alpha 2 4.66
#> 6 1 5003 beta NA 0.886You can use the output from tidy() as input to other crmReporter functions or to your own code built within the Tidyverse. Here are some sample outputs from crmReporter functions. They all use data from the first example study in the original O'Quigley paper.
| Number of patients | Status | |||
|---|---|---|---|---|
| Dose | Treated | Evaluable | No Tox | DLT |
| 0 | 0 | 0 | 0 | 0 |
| 1 | 5 | 5 | 3 | 2 |
| 2 | 15 | 15 | 11 | 4 |
| 3 | 3 | 3 | 2 | 1 |
| 4 | 2 | 2 | 1 | 1 |
| p(Tox) | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Patients | Quantiles | |||||||||
| Dose | Treated | Evaluable | No Tox | Tox | Mean | 5% | 10% | Median | 90% | 95% |
| 1 | 5 | 5 | 3 | 2 | 0.22 | 0.02 | 0.16 | 0.22 | 0.27 | 0.67 |
| 2 | 15 | 15 | 11 | 4 | 0.31 | 0.05 | 0.25 | 0.31 | 0.37 | 0.74 |
| 3 | 3 | 3 | 2 | 1 | 0.44 | 0.13 | 0.38 | 0.44 | 0.50 | 0.81 |
| 4 | 2 | 2 | 1 | 1 | 0.54 | 0.22 | 0.48 | 0.54 | 0.60 | 0.85 |
| 5 | 0 | 0 | 0 | 0 | 0.70 | 0.42 | 0.66 | 0.70 | 0.74 | 0.91 |
| 6 | 0 | 0 | 0 | 0 | 0.83 | 0.64 | 0.81 | 0.83 | 0.86 | 0.95 |



