borrow_simulate: borrow simulation

Description Usage Arguments Examples

View source: R/borrow_simulate.r

Description

borrow trial simulations for multiple subgroups using borrow method.

Usage

1
2
3
4
borrow_simulate(resp, is.resp.rate, size, name, drug_index,
  interim_size = NA, p0 = 0.15, num_sim = 100, shape1 = 0.5,
  shape2 = 0.5, prior = rep(1, length(size))/2, hpd_alpha = 0.05,
  alternative = "greater", call = NULL)

Arguments

resp

the response outcome or the true response rates in each basket.

is.resp.rate

the vector to indicate if the true_rate is response rate (FALSE means the resp value is response outcome)

size

the size of each basket.

name

the name of each basket.

drug_index

the index vector of the basket to be studied.

p0

the null response rate vector for the poster probability calculation (default 0.15).

num_sim

the number of simulationst (default 100).

shape1

the first shape parameter(s) for the prior of each basket (default 0.5).

shape2

the second shape parameter(s) for the prior of each basket (default 0.5).

prior

the matrix giving the prior inclusion probability for each pair of baskets. The default is on on the main diagonal and 0.5 elsewhere.

hpd_alpha

the highest posterior density trial significance.

alternative

the alternative case definition (default greater)

call

the call of the function (default NULL).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# 6 baskets, each with enrollement size 5
trial_sizes <- rep(25, 6)

# The response rates for the baskets.
resp_rate <- 0.15

# The trials: a column of the number of responses and a column of the
# the size of each trial.
trials <- data.frame(
  resprate = rep(0.15, 6),
  size = trial_sizes,
  name = letters[1:6]
)

borrow_simulate(trials$resprate, trials$size, trials$name, drug_index = 1:2)

kaneplusplus/borrow documentation built on Dec. 28, 2019, 11 p.m.