Learn R Programming

basksim

Overview

basksim calculates the operating characteristics of different basket trial designs based on simulation.

Installation

Install the development veresion with:

# install.packages("devtools")
devtools::install_github("lbau7/basksim")

Usage

With basksim you can calculate the operating characteristics such as rejection probabilities and mean squared error of single-stage basket trials with different designs.

At first, you have to create a design-object using a setup-function. For example to create a design-object for Fujikawa’s design (Fujikawa et al., 2020):

library(basksim)
design <- setup_fujikawa(k = 3, shape1 = 1, shape2 = 1, p0 = 0.2)

k is the number of baskets, shape1 and shape2 are the shape parameters of the Beta-prior of the response probabilities of each baskets and p0 is the response probability that defines the null hypothesis.

Use get_details to estimate several important operating characteristics:

get_details(
  design = design,
  n = 20,
  p1 = c(0.2, 0.5, 0.5),
  lambda = 0.95,
  epsilon = 1.5,
  tau = 0,
  iter = 5000
)

# $Rejection_Probabilities
# [1] 0.3448 0.9772 0.9764
# 
# $FWER
# [1] 0.3448
# 
# $Mean
# [1] 0.2781905 0.4795914 0.4789913
# 
# $MSE
# [1] 0.014837404 0.008647713 0.008620234
# 
# $Lower_CL
# [1] 0.1395151 0.3341910 0.3336988
# 
# $Upper_CL
# [1] 0.4262371 0.6252845 0.6245943

Copy Link

Version

Install

install.packages('basksim')

Monthly Downloads

235

Version

1.0.0

License

GPL (>= 3)

Issues

Pull Requests

Stars

Forks

Maintainer

Lukas Baumann

Last Published

April 12th, 2024

Functions in basksim (1.0.0)

get_results.bhm

Get Results for Simulation of a Basket Trial with the BHM Design
adjust_lambda.bhm

Adjust Lambda for the BHM Design
get_details.mml

Get Details of a Basket Trial Simulation with the MML Design
get_details.jsdglobal

Get Details of a Basket Trial Simulation with the Power Prior Design Based on Global JSD Weights
get_results.jsdglobal

Get Results for Simulation of a Basket Trial with the Power Prior Design Based on Global JSD Weights
get_results.mml

Get Results for Simulation of a Basket Trial with the MML Design
get_details.fujikawa

Get Details of a Basket Trial Simulation with Fujikawa's Design
get_details.exnex

Get Details of a Basket Trial Simulation with the EXNEX Design
get_results.mmlglobal

Get Results for Simulation of a Basket Trial with the Global MML Design
get_scenarios

Create a Scenario Matrix
setup_cppglobal

Setup Global Calibrated Power Prior Design Object
get_details.mmlglobal

Get Details of a Basket Trial Simulation with the Global MML Design
opt_design

Optimize a Basket Trial Design
get_results.bma

Get Results for Simulation of a Basket Trial with the BMA Design
adjust_lambda.default

Adjust Lambda
adjust_lambda.exnex

Adjust Lambda for the EXNEX Design
setup_bhm

Setup BHM Design Object
get_details.cpp

Get Details of a Basket Trial Simulation with the Calibrated Power Prior Design
setup_exnex

Setup EXNEX Design Object
get_results

Get Results for Simulation of Basket Trial Designs
setup_bma

Setup bma Design Object
get_details.cppglobal

Get Details of a Basket Trial Simulation with the Global Calibrated Power Prior Design
get_results.exnex

Get Results for Simulation of a Basket Trial with the EXNEX Design
get_results.fujikawa

Get Results for Simulation of a Basket Trial with Fujikawa's Design
toer

Calculate the Type 1 Error Rate for a Basket Trial Design
setup_mml

Setup mml Design Object
setup_cpp

Setup Calibrated Power Prior Design Object
get_results.cpp

Get Results for Simulation of a Basket Trial with a Calibrated Power Prior Design
setup_mmlglobal

Setup mmlglobal Design Object
setup_fujikawa

Setup Fujikawa Design Object
get_results.cppglobal

Get Results for Simulation of a Basket Trial with a Global Calibrated Power Prior Design
setup_jsdglobal

Setup Global JSD Design Object
adjust_lambda

Adjust Lambda
get_details.bhm

Get Details of a BHM Basket Trial Simulation
get_details.bma

Get Details of a BMA Basket Trial Simulation
ecd

Calculate the Expected Number of Correct Decisions for a Basket Trial Design
basksim-package

basksim: Simulation-Based Calculation of Basket Trial Operating Characteristics
get_data

Simulate Data Based on a Binomial Distribution
get_details

Get Details of a Basket Trial Simulation