Learn R Programming

basksim (version 2.0.2)

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

Description

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

Usage

# S3 method for bhm
get_results(
  design,
  n,
  p1 = NULL,
  lambda,
  tau_scale,
  iter = 1000,
  n_mcmc = 10000,
  data = NULL,
  ...
)

Value

A matrix of results with iter rows. A 0 means, that the null hypothesis that the response probability exceeds p0 was not rejected, a 1 means, that the null hypothesis was rejected.

Arguments

design

An object of class bhm.

n

The sample sizes of the baskets. A vector must be used for varying sample sizes.

p1

Probabilities used for the simulation. If NULL then all probabilities are set to p0.

lambda

The posterior probability threshold.

tau_scale

Standard deviation of the half normal prior distribution for the variance of the thetas.

iter

The number of iterations in the simulation. Is ignored if data is specified.

n_mcmc

Number of MCMC samples.

data

An object of class scenario_list as returned by the function bhmbasket::simulateScenarios.

...

Further arguments.

Examples

Run this code
# \donttest{
design <- setup_bhm(k = 3, p0 = 0.2, p_target = 0.5)

# Equal sample sizes
get_results(design, n = 20, p1 = c(0.2, 0.5, 0.5),
  lambda = 0.95, tau_scale = 1, iter = 100)

# Unequal sample sizes
get_results(design, n = c(15, 20, 25), p1 = c(0.2, 0.5, 0.5),
  lambda = 0.95, tau_scale = 1, iter = 100)
# }

Run the code above in your browser using DataLab