diff --git a/articles/analysis_normal.html b/articles/analysis_normal.html index 5d5c386..bf8b1b2 100644 --- a/articles/analysis_normal.html +++ b/articles/analysis_normal.html @@ -410,36 +410,39 @@

Model fitting and visualizat getBootstrapQuantiles() function. For this example, only 6 quantiles are bootstrapped for each model fit.

-getBootstrapQuantiles(
+bs_sample <- getBootstrapSamples(
   model_fits = fit,
-  quantiles  = c(0.025, 0.5, 0.975),
   doses      = c(0, 2.5, 4, 5, 7, 10),
   n_samples  = 6)
-#>    doses      models      2.5%       50%     97.5%
-#> 1    0.0      linear -13.69819 -12.90585 -12.06392
-#> 2    2.5      linear -14.09825 -13.73676 -12.96976
-#> 3    4.0      linear -14.33829 -14.23531 -13.51327
-#> 4    5.0      linear -14.58238 -14.47094 -13.87561
-#> 5    7.0      linear -15.26552 -14.91338 -14.57022
-#> 6   10.0      linear -16.29024 -15.86825 -15.25441
-#> 7    0.0        emax -12.16593 -11.41372 -10.54250
-#> 8    2.5        emax -15.50044 -14.96892 -14.43309
-#> 9    4.0        emax -15.50734 -15.09055 -14.61360
-#> 10   5.0        emax -15.50964 -15.14857 -14.67555
-#> 11   7.0        emax -15.52437 -15.25459 -14.72870
-#> 12  10.0        emax -15.53663 -15.33849 -14.76959
-#> 13   0.0 exponential -13.83941 -13.10680 -12.25959
-#> 14   2.5 exponential -14.11880 -13.73350 -12.95456
-#> 15   4.0 exponential -14.30400 -14.14889 -13.41520
-#> 16   5.0 exponential -14.45552 -14.40045 -13.74207
-#> 17   7.0 exponential -15.09842 -14.78558 -14.42385
-#> 18  10.0 exponential -16.19482 -15.82665 -15.15745
-#> 19   0.0      avgFit -12.16593 -11.41372 -10.54250
-#> 20   2.5      avgFit -15.50044 -14.96892 -14.43309
-#> 21   4.0      avgFit -15.50734 -15.09055 -14.61360
-#> 22   5.0      avgFit -15.50964 -15.14857 -14.67555
-#> 23   7.0      avgFit -15.52437 -15.25459 -14.72870
-#> 24  10.0      avgFit -15.53663 -15.33849 -14.76959
+ +getBootstrapQuantiles( + bs_sample = bs_sample, + quantiles = c(0.025, 0.5, 0.975)) +#> model dose 2.5% 50% 97.5% +#> 1 linear 0.0 -13.69819 -12.90585 -12.06392 +#> 2 linear 2.5 -14.09825 -13.73676 -12.96976 +#> 3 linear 4.0 -14.33829 -14.23531 -13.51327 +#> 4 linear 5.0 -14.58238 -14.47094 -13.87561 +#> 5 linear 7.0 -15.26552 -14.91338 -14.57022 +#> 6 linear 10.0 -16.29024 -15.86825 -15.25441 +#> 7 emax 0.0 -12.16593 -11.41372 -10.54250 +#> 8 emax 2.5 -15.50044 -14.96892 -14.43309 +#> 9 emax 4.0 -15.50734 -15.09055 -14.61360 +#> 10 emax 5.0 -15.50964 -15.14857 -14.67555 +#> 11 emax 7.0 -15.52437 -15.25459 -14.72870 +#> 12 emax 10.0 -15.53663 -15.33849 -14.76959 +#> 13 exponential 0.0 -13.83941 -13.10680 -12.25959 +#> 14 exponential 2.5 -14.11880 -13.73350 -12.95456 +#> 15 exponential 4.0 -14.30400 -14.14889 -13.41520 +#> 16 exponential 5.0 -14.45552 -14.40045 -13.74207 +#> 17 exponential 7.0 -15.09842 -14.78558 -14.42385 +#> 18 exponential 10.0 -16.19482 -15.82665 -15.15745 +#> 19 avgFit 0.0 -12.16593 -11.41372 -10.54250 +#> 20 avgFit 2.5 -15.50044 -14.96892 -14.43309 +#> 21 avgFit 4.0 -15.50734 -15.09055 -14.61360 +#> 22 avgFit 5.0 -15.50964 -15.14857 -14.67555 +#> 23 avgFit 7.0 -15.52437 -15.25459 -14.72870 +#> 24 avgFit 10.0 -15.53663 -15.33849 -14.76959

Technical note: The median quantile of the bootstrap based procedure is not necessary similar to the main model fit, as they are derived via different procedures. The main fit, i.e. the black lines in the plot, diff --git a/articles/analysis_normal_files/figure-html/Plot with bootstrap-1.png b/articles/analysis_normal_files/figure-html/Plot with bootstrap-1.png index fb0a5e0..299178b 100644 Binary files a/articles/analysis_normal_files/figure-html/Plot with bootstrap-1.png and b/articles/analysis_normal_files/figure-html/Plot with bootstrap-1.png differ diff --git a/pkgdown.yml b/pkgdown.yml index 8f3b02f..4bac6ac 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -4,7 +4,7 @@ pkgdown_sha: ~ articles: Simulation_Example: Simulation_Example.html analysis_normal: analysis_normal.html -last_built: 2024-03-20T08:26Z +last_built: 2024-03-20T08:40Z urls: reference: https://boehringer-ingelheim.github.io/BayesianMCPMod/reference article: https://boehringer-ingelheim.github.io/BayesianMCPMod/articles diff --git a/reference/getBootstrapQuantiles.html b/reference/getBootstrapQuantiles.html index 108d21d..37b4bbc 100644 --- a/reference/getBootstrapQuantiles.html +++ b/reference/getBootstrapQuantiles.html @@ -1,15 +1,7 @@ -getBootstrapQuantiles — getBootstrapQuantiles • BayesianMCPModgetBootstrapQuantiles — getBootstrapQuantiles • BayesianMCPMod @@ -63,46 +55,24 @@

-

A function for the calculation of credible intervals to assess the uncertainty for the model fit. -Hereby the credible intervals are calculated as follows. -Samples from the posterior distribution are drawn (via the RBesT function rmix()) and for every sample the simplified fitting step (see getModelFits() function) and a prediction is performed. -These fits are then used to identify the specified quantiles. -This approach can be considered as the Bayesian equivalent of the frequentist bootstrap approach described in O'Quigley et al. (2017). -Instead of drawing n bootstrap samples from the sampling distribution of the trial dose-response estimates, here the samples are directly taken from the posterior distribution.

+

Calculates quantiles from bootstrapped dose predictions. +Can be used to derive credible intervals to assess the uncertainty for the model fit.

Usage

-
getBootstrapQuantiles(
-  model_fits,
-  quantiles,
-  n_samples = 1000,
-  doses = NULL,
-  avg_fit = TRUE
-)
+
getBootstrapQuantiles(bs_samples, quantiles)

Arguments

-
model_fits
-

An object of class modelFits, i.e. information about fitted models & corresponding model coefficients as well as the posterior distribution that was the basis for the model fitting

+
bs_samples
+

An object of class bootstrappedSample as created by getBootstrapSamples

quantiles

A vector of quantiles that should be evaluated

- -
n_samples
-

Number of samples that should be drawn as basis for the bootstrapped quantiles

- - -
doses
-

A vector of doses for which a prediction should be performed

- - -
avg_fit
-

Boolean variable, defining whether an average fit (based on generalized AIC weights) should be performed in addition to the individual models. Default TRUE.

-

Value

@@ -110,10 +80,6 @@

Value

A data frame with entries doses, models, and quantiles

-
-

References

-

O'Quigley J, Iasonos A, Bornkamp B. 2017. Handbook of Methods for Designing, Monitoring, and Analyzing Dose-Finding Trials (1st ed.). Chapman and Hall/CRC. doi:10.1201/9781315151984

-

Examples

@@ -128,21 +94,23 @@

Examples posterior = posterior_list, dose_levels = dose_levels, simple = TRUE) + +bs_samples <- getBootstrapSamples(model_fits = fit, + n_samples = 10, # speeding up example run time + doses = c(0, 6, 8)) -getBootstrapQuantiles(model_fits = fit, - quantiles = c(0.025, 0.5, 0.975), - n_samples = 10, # speeding up example run time - doses = c(0, 6, 8)) -#> doses models 2.5% 50% 97.5% -#> 1 0 exponential 0.21294574 1.469906 2.901673 -#> 2 6 exponential 4.85969091 5.537853 7.140552 -#> 3 8 exponential 5.89278063 7.630167 9.079677 -#> 4 0 linear -0.05792699 1.237644 2.671199 -#> 5 6 linear 5.08611032 5.819201 7.410529 -#> 6 8 linear 6.02743520 7.634307 9.098889 -#> 7 0 avgFit -0.05792699 1.237644 2.671199 -#> 8 6 avgFit 5.08611032 5.819201 7.410529 -#> 9 8 avgFit 6.02743520 7.634307 9.098889 +getBootstrapQuantiles(bs_samples = bs_samples, + quantiles = c(0.025, 0.5, 0.975)) +#> model dose 2.5% 50% 97.5% +#> 1 exponential 0 0.21294574 1.469906 2.901673 +#> 2 exponential 6 4.85969091 5.537853 7.140552 +#> 3 exponential 8 5.89278063 7.630167 9.079677 +#> 4 linear 0 -0.05792699 1.237644 2.671199 +#> 5 linear 6 5.08611032 5.819201 7.410529 +#> 6 linear 8 6.02743520 7.634307 9.098889 +#> 7 avgFit 0 -0.05792699 1.237644 2.671199 +#> 8 avgFit 6 5.08611032 5.819201 7.410529 +#> 9 avgFit 8 6.02743520 7.634307 9.098889