generate.data: Generate Data for A Basket Trial Design

View source: R/generate.data.R

generate.dataR Documentation

Generate Data for A Basket Trial Design

Description

Generate Data for A Basket Trial Design

Usage

generate.data(N, ORRs, ntrial = 10000, seed = 987897)

Arguments

N

a matrix with dim=c(B, stage), where B is the number of baskets and stage is the # of analyses (interim+final)

ORRs

a matrix with dim=c(nS, B), where nS is the number of trial scenarios for objective response rates.

ntrial

the total number of trials simulated.

seed

random seed for reproducibility.

Value

It returns a list including data, N, and ORRs, where data is an array with dim=c(nS, ntrial, B, stage).

Examples

N <- rbind(
c(10, 25),
c(10, 25),
c(10, 25)) # interim sample size and total sample size for each indication
scenarios <- rbind( c(0.15, 0.15, 0.15), c(0.3, 0.3, 0.3) )
res <- generate.data(N = N, ORRs = scenarios, ntrial = 20, seed = 2024)

BasketTrial documentation built on June 18, 2025, 5:08 p.m.