TwoSampleBernoulli {BayesDIP}R Documentation

Two sample Bernoulli model

Description

For a given planned sample size, the efficacy and futility boundaries, return the power, the type I error, the expected sample size and its standard deviation, the probability of reaching the efficacy and futility boundaries. Equal allocation between two treatment groups.

Usage

TwoSampleBernoulli(
  prior,
  N = 200,
  p1,
  p2,
  d = 0,
  ps = 0.95,
  pf = 0.05,
  alternative = c("less", "greater"),
  seed = 202209,
  sim = 5000
)

Arguments

prior

A list of length 3 containing the distributional information of the prior. The first element is a number specifying the type of prior. Options are

  1. DIP ;

  2. Beta(a,b), where a = shape, b = scale

The second and third elements of the list are the parameters a and b, respectively.

N

The total planned sample size for two treatment groups.

p1

The response rate of the new treatment.

p2

The response rate of the compared treatment.

d

The target improvement (minimal clinically meaningful difference).

ps

The efficacy boundary (upper boundary).

pf

The futility boundary (lower boundary).

alternative

less (lower values imply greater efficacy) or greater (larger values imply greater efficacy).

seed

The seed for simulations.

sim

The number of simulations.

Value

A list of the arguments with method and computed elements

Examples

# with traditional Bayesian prior Beta(1,1)
TwoSampleBernoulli(list(2,1,1), N = 200, p1 = 0.5, p2 = 0.3, d = 0,
                   ps = 0.90, pf = 0.05, alternative = "greater",
                   seed = 202210, sim = 5)
# with DIP
TwoSampleBernoulli(list(1,0,0), N = 200, p1 = 0.5, p2 = 0.3, d = 0,
                   ps = 0.90, pf = 0.05, alternative = "greater",
                   seed = 202210, sim = 5)

[Package BayesDIP version 0.1.1 Index]