Learn R Programming

tipmap

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:

install.packages("tipmap")

GitHub

You can install the current development version from GitHub with:

if (!require("remotes")) {install.packages("remotes")}
remotes::install_github("Boehringer-Ingelheim/tipmap")

Getting started

Load the package:

library(tipmap)

The prior data (collected in the source population):

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):

ped_trial <- create_new_trial_data(
  n_total = 30, 
  est = 1.27, 
  se = 0.95
)

Derivation of the meta-analytic predictive (MAP) prior:

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)
  )
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:

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):

tipmap_data <- create_tipmap_data(
  new_trial_data = ped_trial,
  posterior = posterior,
  map_prior = map_prior)

Create tipping point plot:

tipmap_plot(tipmap_data = tipmap_data)

Get tipping points:

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: Morten Dreher and Christian Stock (2022). tipmap: Tipping Point Analysis for Bayesian Dynamic Borrowing. R package version 0.4.2. URL: https://CRAN.R-project.org/package=tipmap

Copy Link

Version

Install

install.packages('tipmap')

Monthly Downloads

161

Version

0.5.2

License

Apache License 2.0

Issues

Pull Requests

Stars

Forks

Maintainer

Christian Stock

Last Published

August 14th, 2023

Functions in tipmap (0.5.2)

get_tipping_points

Identify tipping point for a specific quantile.
oc_bias

Assessing bias
oc_pos

Assessing probability of success
tipmap_darkblue

Custom dark blue
oc_coverage

Assessing coverage
get_posterior_by_weight

Filter posterior by given weights
get_summary_mult_exp

Summarize expert weights
load_tipmap_data

Load exemplary datasets
get_model_input_1exp

Transform cumulative probabilities to fit beta distributions
tipmap-package

tipmap: Tipping Point Analysis for Bayesian Dynamic Borrowing
tipmap_lightred

Custom light red
tipmap_plot

Visualize tipping point analysis
draw_beta_mixture_nsamples

Draw samples from a mixture of beta distributions
create_posterior_data

Creates posterior distributions for a range of weights on the informative component of the robust MAP prior
fit_beta_1exp

Fit beta distribution for one expert
fit_beta_mult_exp

Fit beta distributions for multiple experts
get_cum_probs_1exp

Get cumulative probabilities from distribution of chips of one expert
create_new_trial_data

Data on new trial in target population
default_weights

Default weights
create_tipmap_data

Create data frame ready to use for tipping point analysis
create_prior_data

Creates input data frame for construction of MAP prior
default_quantiles

Default quantiles