get_results.cpplim: Get Results for Simulation of a Basket Trial with a Limited...

View source: R/get_results.R

get_results.cpplimR Documentation

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

Description

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

Usage

## S3 method for class 'cpplim'
get_results(
  design,
  n,
  p1 = NULL,
  lambda,
  tune_a,
  tune_b,
  iter = 1000,
  data = NULL,
  ...
)

Arguments

design

An object of class cpplim.

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.

tune_a

First tuning parameter that determines the amount of borrowing based on pairwise similarity between baskets.

tune_b

Second tuning parameter that determines the amount of borrowing based on pairwise similarity between baskets.

iter

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

data

A data matrix with k column with the number of responses for each basket. Has to be generated with get_data. If data is used, then iter is ignored.

...

Further arguments.

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.

Examples

design <- setup_cpplim(k = 3, p0 = 0.2)

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

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

basksim documentation built on May 12, 2026, 9:08 a.m.