mem_single: Fit the MEM Model for single subgroup

Description Usage Arguments Examples

View source: R/mem_single.r

Description

Fit the MEM model for single subgroup using full Bayesian inference.

Usage

1
2
3
mem_single(responses, size, name, drug_index, p0 = 0.15, shape1 = 0.5,
  shape2 = 0.5, prior = rep(1, length(responses))/2,
  hpd_alpha = 0.05, alternative = "greater", call = NULL)

Arguments

responses

the number of responses in each basket.

size

the size of each basket.

name

the name of each basket.

drug_index

the index of the basket to be studied.

p0

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

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(
  responses = rbinom(trial_sizes, trial_sizes, resp_rate),
  size = trial_sizes,
  name = letters[1:6]
)

mem_single(trials$responses, trials$size, trials$name, drug_index = 2)

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