diff --git a/vignettes/expert_elicitation.Rmd b/vignettes/expert_elicitation.Rmd index 778127b..a2a1972 100644 --- a/vignettes/expert_elicitation.Rmd +++ b/vignettes/expert_elicitation.Rmd @@ -41,7 +41,7 @@ This vignette provides a brief description of how expert elicitation can be used The data in this example are hypothetical data. Loading the `tipmap` package: -```{r, eval=F, echo=T} +```{r, eval=T, echo=T} library(tipmap) ``` @@ -52,7 +52,7 @@ Here, the expert data are assumed to be collected via the 'roulette method' (Gos The experts are asked to place 10 chips into a grid to create histogram-like data that reflects their preferred weighting. No particular shape of symmetry is needed. Data from a single expert: -```{r chips_single1, eval=F, echo=T} +```{r chips_single1, eval=T, echo=T} chips_1exp <- c(1, 3, 4, 2, 0, 0, 0, 0, 0, 0) sum(chips_1exp) ``` @@ -62,7 +62,7 @@ sum(chips_1exp) The roulette data are assumed to follow a beta distribution. The following calculation and fitting of a beta distribution is similar to an implementation in `SHELF::fitdist` and yields identical results. Data from a single expert: -```{r chips_single2, eval=F, echo=T} +```{r chips_single2, eval=T, echo=T} # Compute cumulative probabilities (x <- get_cum_probs_1exp(chips_1exp)) # Compute model inputs @@ -73,7 +73,7 @@ Data from a single expert: For multiple experts the individual steps are handled by the `fit_beta_mult_exp`-function: -```{r chips_multiple, eval=F, echo=T} +```{r chips_multiple, eval=T, echo=T} beta_fits <- fit_beta_mult_exp( chips_mult <- rbind( @@ -92,7 +92,7 @@ beta_fits Summary statistics for a single expert: -```{r fit_beta_1a, eval=F, echo=T} +```{r fit_beta_1a, eval=T, echo=T} (alpha <- fit_1exp[1]); (beta <- fit_1exp[2]) # Mean @@ -123,12 +123,12 @@ sd(x) Summary statistics for data from multiple experts: -```{r fit_beta_2a, eval=F, echo=T} +```{r fit_beta_2a, eval=T, echo=T} expert_samples <- draw_beta_mixture_nsamples(n=10^3, chips_mult=chips_mult) summary(expert_samples) ``` -```{r fit_beta_2b, eval=F, echo=T} +```{r fit_beta_2b, eval=T, echo=T} (mean_w <- round(mean(expert_samples), 2)) ``` @@ -136,14 +136,14 @@ Mean or median values of the pooled distribution may be used as primary weights ## Figures -```{r load_libs, eval=F, echo=T} +```{r load_libs, eval=T, echo=T} # Load libraries packages <- c("magrittr", "ggplot2", "tibble", "dplyr") invisible(lapply(packages, library, character.only = T)) ``` ### Without linear pooling -```{r elicitfig1a, eval=F, echo=T} +```{r elicitfig1a, eval=T, echo=T} # Create matrix fits_mat <- as.matrix(beta_fits[,c(1,2)]) # Wide format @@ -163,7 +163,7 @@ fit_beta_mult_plot_long <- fit_beta_mult_plot_wide %>% values_to = "dens") ``` -```{r elicitfig1b, eval=F, echo=T, fig.width=8, fig.height=5, dev=c('png'), out.width="95%"} +```{r elicitfig1b, eval=T, echo=T, fig.width=8, fig.height=5, dev=c('png'), out.width="95%"} # Plot without linear pool fig_betas_1 <- ggplot( data = fit_beta_mult_plot_long, @@ -178,7 +178,7 @@ print(fig_betas_1) ``` ### With linear pooling -```{r elicitfig2a, eval=F, echo=T} +```{r elicitfig2a, eval=T, echo=T} # Wide format fit_beta_mult_plot_wide2 <- fit_beta_mult_plot_wide %>% mutate(linpool = (Expert1 + Expert2 + Expert3 + Expert4 + Expert5)/5) @@ -190,7 +190,7 @@ fit_beta_mult_plot_long2 <- fit_beta_mult_plot_wide %>% values_to = "dens") ``` -```{r elicitfig2b, eval=F, echo=T, fig.width=8, fig.height=5, dev=c('png'), out.width="95%"} +```{r elicitfig2b, eval=T, echo=T, fig.width=8, fig.height=5, dev=c('png'), out.width="95%"} # Plot fig_betas_2 <- ggplot( data = fit_beta_mult_plot_long2, @@ -215,7 +215,7 @@ Best, N., Dallow, N. and Montague, T. (2020) Prior Elicitation. In: Lesaffre E, Dallow, N., Best, N. and Montague, T. H. (2018) Better decision making in drug development through adoption of formal prior elicitation. Pharm Stat, 17, 301–316. -Gosling, J. P. (2018) SHELF: The sheffield elicitation framework. In Elicitation: The Science and Art of Structuring Judgement (eds L. C. Dias, A. Morton, and J. Quigley), pp. 61–93. Springer International Publishing. +Gosling, J. P. (2018) SHELF: The Sheffield Elicitation Framework. In Elicitation: The Science and Art of Structuring Judgement (eds L. C. Dias, A. Morton, and J. Quigley), pp. 61–93. Springer International Publishing. Ionan, A. C., Clark, J., Travis, J., et al. (2022) Bayesian Methods in Human Drug and Biological Products Development in CDER and CBER. Ther Innov Regul Sci,, to appear.