opchar determines the operating characteristics (analytically) of a design returned by des_one_stage or des_two_stage, under given response rate scenarios (see pi).

opchar(
  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 operating characteristics. 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_opchar", containing each of the input parameters along with a tibble in the slot $opchar, which gives the determined operating characteristics.

See also

Examples

# The default two-stage design des <- des_two_stage() # Its operating characteristics under the uninteresting and interesting # scenarios opchar <- opchar(des) # The same operating characteristics, conditioning on the trial ending in # stage 2 opchar <- opchar(des, k = 2)