Skip to content

Commit

Permalink
removed explicit calls
Browse files Browse the repository at this point in the history
  • Loading branch information
Andersen committed Jun 28, 2024
1 parent 830ef94 commit 46a6e20
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion vignettes/analysis_normal.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ plot(fit, cr_bands = TRUE)
The bootstrap based quantiles can also be directly calculated via the getBootstrapQuantiles() function.
For this example, only 6 quantiles are bootstrapped for each model fit.
```{r Bootstrap}
BayesianMCPMod::getBootstrapQuantiles(
getBootstrapQuantiles(
model_fits = fit,
quantiles = c(0.025, 0.5, 0.975),
doses = c(0, 2.5, 4, 5, 7, 10),
Expand Down
20 changes: 10 additions & 10 deletions vignettes/analysis_normal_noninformative.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ In the first step of Bayesian MCPMod, the posterior is calculated by combining
the prior information with the estimated results of the trial [@fleischer_2022].

```{r}
posterior <- BayesianMCPMod::getPosterior(
posterior <- getPosterior(
prior_list = prior_list,
mu_hat = trial_data$rslt,
se_hat = trial_data$se,
Expand All @@ -247,14 +247,14 @@ A pseudo-optimal contrast matrix is generated based on the variability of the
posterior distribution (see [@fleischer_2022] for more details).

```{r}
crit_pval <- BayesianMCPMod::getCritProb(
crit_pval <- getCritProb(
mods = mods,
dose_levels = dose_levels,
se_new_trial = trial_data$se,
alpha_crit_val = 0.05
)
contr_mat <- BayesianMCPMod::getContr(
contr_mat <- getContr(
mods = mods,
dose_levels = dose_levels,
sd_posterior = summary(posterior)[, 2]
Expand All @@ -269,18 +269,18 @@ executed and the contrast specification above is used.
#| eval: false
# i) the frequentist contrast
contr_mat_prior <- BayesianMCPMod::getContr(
contr_mat_prior <- getContr(
mods = mods,
dose_levels = dose_levels,
dose_weights = n_patients,
prior_list = prior_list)
# ii) re-estimated frequentist contrasts
contr_mat_prior <- BayesianMCPMod::getContr(
contr_mat_prior <- getContr(
mods = mods,
dose_levels = dose_levels,
se_new_trial = trial_data$se)
# iii) Bayesian approach using number of patients for new trial and prior distribution
contr_mat_prior <- BayesianMCPMod::getContr(
contr_mat_prior <- getContr(
mods = mods,
dose_levels = dose_levels,
dose_weights = n_patients,
Expand All @@ -290,7 +290,7 @@ contr_mat_prior <- BayesianMCPMod::getContr(
The Bayesian MCP testing step is then executed:

```{r}
BMCP_result <- BayesianMCPMod::performBayesianMCP(
BMCP_result <- performBayesianMCP(
posterior_list = posterior,
contr = contr_mat,
crit_prob_adj = crit_pval)
Expand Down Expand Up @@ -329,7 +329,7 @@ present the full fit.
```{r}
# If simple = TRUE, uses approx posterior
# Here we use complete posterior distribution
fit <- BayesianMCPMod::getModelFits(
fit <- getModelFits(
models = mods,
dose_levels = dose_levels,
posterior = posterior,
Expand Down Expand Up @@ -368,7 +368,7 @@ The bootstrap based quantiles can also be directly calculated via the
For this example, only 6 quantiles are bootstrapped for each model fit.

```{r}
bootstrap_quantiles <- BayesianMCPMod::getBootstrapQuantiles(
bootstrap_quantiles <- getBootstrapQuantiles(
model_fits = fit,
quantiles = c(0.025, 0.5, 0.975),
doses = c(0, 2.5, 4, 5, 7, 10),
Expand Down Expand Up @@ -403,7 +403,7 @@ but this is not run here.

```{r}
#| eval: false
BayesianMCPMod::performBayesianMCPMod(
performBayesianMCPMod(
posterior_list = posterior,
contr = contr_mat,
crit_prob_adj = crit_pval,
Expand Down

0 comments on commit 46a6e20

Please sign in to comment.