Skip to contents

Performs Bayesian MCP Test step and modeling in a combined fashion. See performBayesianMCP() function for MCP Test step and getModelFits() for the modeling step

Usage

performBayesianMCPMod(posterior_list, contr, crit_prob_adj, simple = FALSE)

Arguments

posterior_list

An object of class 'postList' as created by getPosterior() containing information about the (mixture) posterior distribution per dose group

contr

An object of class 'optContr' as created by the getContr() function. It contains the contrast matrix to be used for the testing step.

crit_prob_adj

A getCritProb object, specifying the critical value to be used for the testing (on the probability scale).

simple

Boolean variable, defining whether simplified fit will be applied. Passed to the getModelFits() function. Default FALSE.

Value

Bayesian MCP test result as well as modeling result.

Examples

mods <- DoseFinding::Mods(linear      = NULL,
                          linlog      = NULL,
                          emax        = c(0.5, 1.2),
                          exponential = 2,
                          doses       = c(0, 0.5, 2,4, 8))
dose_levels  <- c(0, 0.5, 2, 4, 8)
sd_posterior <- c(2.8, 3, 2.5, 3.5, 4)
contr_mat <- getContr(
  mods         = mods,
  dose_levels  = dose_levels,
  sd_posterior = sd_posterior)
critVal <- getCritProb(
  mods           = mods,
  dose_weights   = c(50, 50, 50, 50, 50), #reflecting the planned sample size
  dose_levels    = dose_levels,
  alpha_crit_val = 0.05)
prior_list <- list(Ctrl = RBesT::mixnorm(comp1 = c(w = 1, m = 0, s = 5), sigma = 2),
                   DG_1 = RBesT::mixnorm(comp1 = c(w = 1, m = 1, s = 12), sigma = 2),
                   DG_2 = RBesT::mixnorm(comp1 = c(w = 1, m = 1.2, s = 11), sigma = 2) ,
                   DG_3 = RBesT::mixnorm(comp1 = c(w = 1, m = 1.3, s = 11), sigma = 2) ,
                   DG_4 = RBesT::mixnorm(comp1 = c(w = 1, m = 2, s = 13), sigma = 2))
mu <- c(0, 1, 1.5, 2, 2.5)
S_hat <- c(5, 4, 6, 7, 8)
posterior_list <- getPosterior(
  prior_list = prior_list,
  mu_hat     = mu,
  S_hat     = S_hat)
performBayesianMCPMod(posterior_list = posterior_list,
                      contr          = contr_mat,
                      crit_prob_adj  = critVal,
                      simple         = FALSE)
#> Bayesian Multiple Comparison Procedure
#> Summary:
#>   Sign: 0 
#>   Critical Probability: 0.9752816 
#>   Maximum Posterior Probability: 0.6446552 
#> 
#> Posterior Probabilities for Model Shapes:
#>        Model Probability
#>       linear   0.6191201
#>       linlog   0.6446552
#>        emax1   0.6412959
#>        emax2   0.6410572
#>  exponential   0.5839261