pmf determines probability mass functions of a design returned by des_one_stage or des_two_stage, under given response rate scenarios (see pi).

pmf(
  des = ph2rand::des_one_stage(),
  pi = des$opchar[, 1:2],
  k = 1:des$J,
  summary = FALSE
)

Arguments

des

An object of class ph2rand_des, as returned by des_one_stage or des_two_stage. Defaults to ph2rand::des_one_stage().

pi

A numeric vector with two elements, or a numeric matrix or data.frame with two columns, giving the response rate scenarios to consider. The first element/column should correspond to the control arm and the second element/column to the experimental arm. Defaults to des$opchar[, 1:2].

k

A numeric vector indicating which stages to consider in determining the probability mass functions. That is, it will condition the calculations on the trial ending in the stages given in k. Defaults to 1:des$J (i.e., to all stages of the given design).

summary

A logical variable indicating whether a summary of the function's progress should be printed to the console. Defaults to FALSE.

Value

A list with additional class "ph2rand_pmf", containing each of the input parameters along with a tibble in the slot $pmf, which gives the determined probability mass functions.

See also

Examples

# The default two-stage design des <- des_two_stage() # Its probability mass function under the uninteresting and interesting # scenarios pmf <- pmf(des) # The same probability mass functions, conditioning on the trial ending in # stage 2 pmf <- pmf(des, k = 2)