Skip to content

Commit

Permalink
New draft vignette around simulation added
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbossert committed Oct 18, 2023
1 parent b45e0b2 commit 31ebd7f
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
1 change: 1 addition & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ articles:
navbar: ~
contents:
- analysis_normal
- Simulation_Example
58 changes: 58 additions & 0 deletions vignettes/Simulation_Example.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
title: "Simulation Example of Bayesian MCPMod for Continuous Data"
output: rmarkdown::html_vignette
number_sections: true
vignette: >
%\VignetteIndexEntry{Simulation Example of Bayesian MCPMod for Continuous Data}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---

```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```

```{r setup}
library(BayesianMCPMod)
library(clinDR)
library(dplyr)
set.seed(7015)
```

# Background and data

In this vignette we will show the use of the Bayesian MCPMod package for trial planning for continuous distributed data.
As in [link other vignette] we focus on the indication MDD and make use of historical data that is included in the clinDR package.
More specifically trial results for BRINTELLIX will be utilized to establish an informative prior for the control group.

# Calculation of a MAP prior
In a first step a meta analytic prior will be calculated using historical data from 4 trials (with main endpoint CfB in MADRS score after 8 weeks).
Please note that only information from the control group will be integrated (leading to an informative multicomponent prior for the control group), while for the active groups a non-informative prior will be specified.


```{r Calculation of a MAP prior}
data("metaData")
testdata <- as.data.frame(metaData)
dataset <- filter(testdata, bname == "BRINTELLIX")
histcontrol <- filter(dataset, dose == 0, primtime == 8, indication == "MAJOR DEPRESSIVE DISORDER")
##Create MAP Prior
hist_data <- data.frame(
trial = histcontrol$nctno,
est = histcontrol$rslt,
se = histcontrol$se,
sd = histcontrol$sd,
n = histcontrol$sampsize)
dose_levels <- c(0, 2.5, 5, 10, 20)
prior_list <- getPriorList(
hist_data = hist_data,
dose_levels = dose_levels)
```

0 comments on commit 31ebd7f

Please sign in to comment.