diff --git a/R/BMCPMod.R b/R/BMCPMod.R index 023d3c6..efeeede 100644 --- a/R/BMCPMod.R +++ b/R/BMCPMod.R @@ -95,7 +95,7 @@ assessDesign <- function ( attr(eval_design, "placEff") <- attr(mods, "placEff") attr(eval_design, "maxEff") <- attr(mods, "maxEff") attr(eval_design, "sampleSize") <- n_patients - attr(eval_design, "priorESS") <- getESS(prior_list) + attr(eval_design, "priorESS") <- round(getESS(prior_list), 1) return (eval_design) @@ -210,17 +210,16 @@ getCritProb <- function ( mods, dose_levels, - dose_weights =NULL, - se_new_trial = NULL, + dose_weights = NULL, + se_new_trial = NULL, alpha_crit_val = 0.025 ) { - contr <- getContr(mods = mods, - dose_levels = dose_levels , - dose_weights = dose_weights, - se_new_trial = se_new_trial, - alpha_crit_val = alpha_crit_val) + contr <- getContr(mods = mods, + dose_levels = dose_levels , + dose_weights = dose_weights, + se_new_trial = se_new_trial) crit_prob <- stats::pnorm(DoseFinding::critVal( corMat = contr$corMat, diff --git a/R/posterior.R b/R/posterior.R index c29e011..fcc67ab 100644 --- a/R/posterior.R +++ b/R/posterior.R @@ -87,12 +87,18 @@ getPosteriorI <- function( } - names(post_list) <- names(prior_list) - class(post_list) <- "postList" - attr(post_list, "ess") <- ifelse( - test = calc_ess, - yes = getESS(post_list), - no = numeric(0)) + names(post_list) <- names(prior_list) + class(post_list) <- "postList" + + if (calc_ess) { + + attr(post_list, "ess") <- getESS(post_list) + + } else { + + attr(post_list, "ess") <- numeric(0) + + } return (post_list)