Skip to contents

Construct arm-specific variance confidence intervals for a shared-control multi-arm design.

Usage

rectangle_multiarm(
  y,
  arm,
  alpha = 0.05,
  method = c("auto", "bounded", "bernoulli", "maurer_pontil", "mp", "bernoulli_exact",
    "martinez_taboada_ramdas", "mtr"),
  beta = NULL,
  control_arm = 0,
  normalize = FALSE,
  lower = NULL,
  upper = NULL,
  na.rm = TRUE,
  tol = 1e-11
)

Arguments

y

Pilot outcomes.

arm

Pilot arm labels. The control arm is identified by control_arm and internally standardized to "0".

alpha

Target joint error level.

method

Confidence-set method. "auto" chooses exact Bernoulli bounds for 0/1 outcomes and bounded Maurer–Pontil bounds otherwise.

beta

Optional endpoint error allocation. If NULL, Bonferroni error is split across all lower and upper arm endpoints. A scalar, matrix, or named vector allocation may also be supplied.

control_arm

Label identifying the control arm in arm.

normalize

If TRUE, normalize bounded outcomes to [0, 1] before computing variances. For guarantee-bearing bounded CMR on a non-unit scale, provide known lower and upper bounds.

lower, upper

Optional lower and upper outcome bounds used when normalize = TRUE. If either is omitted, the pilot minimum and/or maximum is used with a warning; that data-dependent normalization is exploratory and does not carry the finite-sample bounded-outcome CMR guarantee.

na.rm

If TRUE, drop rows with missing y or arm.

tol

Numerical tolerance for exact Bernoulli bound inversion.

Value

A list of class cmr_multiarm_rectangle with checked rectangle, arm labels, one-arm bound results, endpoint error allocation, sample sizes, pilot variance estimates, normalization details, and method metadata.

Examples

set.seed(6)
arm <- rep(c(0, 1, 2), each = 12)
y <- c(rbeta(12, 4, 4), rbeta(12, 2, 6), rbeta(12, 5, 3))
rectangle_multiarm(y, arm, method = "bounded")
#> $rectangle
#>   lower upper
#> 0     0  0.25
#> 1     0  0.25
#> 2     0  0.25
#> 
#> $arms
#> [1] "0" "1" "2"
#> 
#> $arm_results
#> $arm_results$`0`
#> $arm_results$`0`$L
#> [1] 0
#> 
#> $arm_results$`0`$U
#> [1] 0.25
#> 
#> $arm_results$`0`$vhat
#> [1] 0.01942598
#> 
#> $arm_results$`0`$method
#> [1] "bounded"
#> 
#> $arm_results$`0`$n
#> [1] 12
#> 
#> $arm_results$`0`$statistic
#> $arm_results$`0`$statistic$vhat
#> [1] 0.01942598
#> 
#> $arm_results$`0`$statistic$projected_vhat
#> [1] 0.01942598
#> 
#> $arm_results$`0`$statistic$sdhat
#> [1] 0.1393771
#> 
#> $arm_results$`0`$statistic$beta_l
#> [1] 0.008333333
#> 
#> $arm_results$`0`$statistic$beta_u
#> [1] 0.008333333
#> 
#> 
#> 
#> $arm_results$`1`
#> $arm_results$`1`$L
#> [1] 0
#> 
#> $arm_results$`1`$U
#> [1] 0.25
#> 
#> $arm_results$`1`$vhat
#> [1] 0.02244602
#> 
#> $arm_results$`1`$method
#> [1] "bounded"
#> 
#> $arm_results$`1`$n
#> [1] 12
#> 
#> $arm_results$`1`$statistic
#> $arm_results$`1`$statistic$vhat
#> [1] 0.02244602
#> 
#> $arm_results$`1`$statistic$projected_vhat
#> [1] 0.02244602
#> 
#> $arm_results$`1`$statistic$sdhat
#> [1] 0.14982
#> 
#> $arm_results$`1`$statistic$beta_l
#> [1] 0.008333333
#> 
#> $arm_results$`1`$statistic$beta_u
#> [1] 0.008333333
#> 
#> 
#> 
#> $arm_results$`2`
#> $arm_results$`2`$L
#> [1] 0
#> 
#> $arm_results$`2`$U
#> [1] 0.25
#> 
#> $arm_results$`2`$vhat
#> [1] 0.03277218
#> 
#> $arm_results$`2`$method
#> [1] "bounded"
#> 
#> $arm_results$`2`$n
#> [1] 12
#> 
#> $arm_results$`2`$statistic
#> $arm_results$`2`$statistic$vhat
#> [1] 0.03277218
#> 
#> $arm_results$`2`$statistic$projected_vhat
#> [1] 0.03277218
#> 
#> $arm_results$`2`$statistic$sdhat
#> [1] 0.1810309
#> 
#> $arm_results$`2`$statistic$beta_l
#> [1] 0.008333333
#> 
#> $arm_results$`2`$statistic$beta_u
#> [1] 0.008333333
#> 
#> 
#> 
#> 
#> $alpha
#> [1] 0.05
#> 
#> $beta
#>         lower       upper
#> 0 0.008333333 0.008333333
#> 1 0.008333333 0.008333333
#> 2 0.008333333 0.008333333
#> 
#> $joint_error_bound
#> [1] 0.05
#> 
#> $method
#> [1] "bounded"
#> 
#> $n
#>  0  1  2 
#> 12 12 12 
#> 
#> $vhat
#>          0          1          2 
#> 0.01942598 0.02244602 0.03277218 
#> 
#> $normalization
#> NULL
#> 
#> $control_arm
#> [1] 0
#> 
#> attr(,"class")
#> [1] "cmr_multiarm_rectangle" "list"