-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
129 lines (102 loc) · 3.55 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>", prompt = FALSE,
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# tipmap <img src="man/figures/logo.png" align="right" height="139" alt="" />
<!-- badges: start -->
[![](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable)
[![](https://www.r-pkg.org/badges/version/tipmap)](https://cran.r-project.org/package=tipmap)
[![](http://cranlogs.r-pkg.org/badges/last-month/tipmap)](https://cran.r-project.org/package=tipmap)
[![](http://cranlogs.r-pkg.org/badges/grand-total/tipmap)](https://cran.r-project.org/package=tipmap)
<!-- badges: end -->
The `tipmap`-package facilitates the planning and analysis of partial extrapolation studies in pediatric drug development. It provides an implementation of a Bayesian tipping point approach that can be used in analyses based on robust meta-analytic predictive (MAP) priors. Further functions facilitate expert elicitation of a primary (pre-specified) weight of the informative component of the MAP prior and the computation of operating characteristics.
## Installation
**CRAN**
You can install the current stable version from CRAN with:
```{r cran-installation, eval = FALSE}
install.packages("tipmap")
```
**GitHub**
You can install the current development version from GitHub with:
```{r gh-installation, eval = FALSE}
if (!require("remotes")) {install.packages("remotes")}
remotes::install_github("Boehringer-Ingelheim/tipmap")
```
## Getting started
Load the package:
```{r example01, eval = FALSE}
library(tipmap)
```
The prior data (collected in the source population):
```{r example02, eval = FALSE}
prior_data <- create_prior_data(
n_total = c(160, 240, 320),
est = c(1.23, 1.40, 1.51),
se = c(0.4, 0.36, 0.31)
)
```
The data from the new trial (collected in the target population):
```{r example03, eval = FALSE}
ped_trial <- create_new_trial_data(
n_total = 30,
est = 1.27,
se = 0.95
)
```
Derivation of the meta-analytic predictive (MAP) prior:
```{r example04, eval = FALSE}
uisd <- sqrt(ped_trial["n_total"]) * ped_trial["se"]
g_map <-
RBesT::gMAP(
formula = cbind(est, se) ~ 1 | study_label,
data = prior_data,
family = gaussian,
weights = n_total,
tau.dist = "HalfNormal",
tau.prior = cbind(0, uisd / 16),
beta.prior = cbind(0, uisd)
)
```
```{r example05, eval = FALSE}
map_prior <- RBesT::automixfit(
sample = g_map,
Nc = seq(1, 4),
k = 6,
thresh = -Inf
)
```
Computing the posterior distribution for weights of the informative component of the MAP prior ranging from 0 to 1:
```{r example06, eval = FALSE}
posterior <- create_posterior_data(
map_prior = map_prior,
new_trial_data = ped_trial,
sigma = uisd)
```
Creating data for a tipping point analysis (tipping point plot):
```{r example07, eval = FALSE}
tipmap_data <- create_tipmap_data(
new_trial_data = ped_trial,
posterior = posterior,
map_prior = map_prior)
```
Create tipping point plot:
```{r example08, eval = FALSE}
tipmap_plot(tipmap_data = tipmap_data)
```
Get tipping points:
```{r example09, eval = FALSE}
get_tipping_points(
tipmap_data,
quantile = c(0.025, 0.05, 0.1, 0.2),
null_effect = 0.1)
```
## Citing `tipmap`
To cite `tipmap` in publications please use: Christian Stock and Morten Dreher (2023). tipmap: Tipping Point Analysis for Bayesian Dynamic Borrowing. R package version 0.5.2. URL: https://CRAN.R-project.org/package=tipmap