Skip to contents

Perform Obrien truncated closed testing

Usage

obt(
  data,
  endpoint_vars,
  jendpoint = NULL,
  treatment_vars,
  alpha = 0.05,
  nu = 0.8,
  method = c("ols", "gls", "ranksum"),
  var.equal = TRUE,
  ...
)

Arguments

data

input data; columns should contain endpoint data and must be named E1, E2

endpoint_vars

vector of endpoint column names (character/vector)

jendpoint

joint endpoint, a vector of individual endpoints (character/vector)

treatment_vars

treatment column name (character/scalar)

alpha

significance level (numeric/scalar)

nu

truncation parameter, between 0 and 1 (numeric/scalar; default = 0.8)

method

estimation method (character/scalar; default = 'OLS')

var.equal

assume equal variances? (logical/scalar; default = TRUE)

...

additional arguments passed to obrien

Value

a list containing the following elements:

  • F: target family of hypotheses (character/vector)

  • df: data.frame with relevant hypotheses and parameters

  • df_gst: data.frame with results from the different procedures

  • alpha_A: unused alpha available for propagation to the next family

Note

This is the truncated closed test as proposed by: Luo, X., Li, L., Savenkov, O., Liu, W., Ni, X., Tang, W. and Guo, W., 2025. Multiple Comparisons Procedures for Analyses of Joint Primary Endpoints and Secondary Endpoints. Pharmaceutical Statistics, 24(3), p.e70010. doi: https://doi.org/10.1002/pst.70010

Input Data Requirements

The endpoint variables in data must be named E1, E2, E3, etc. for the function to work correctly. If you endpoint columns do not have this naming convention, you must rename them.

Examples

dat <- multcomp::mtept
dat$E4 <- -dat$E4  # align signs for all endpoints
obt(
    data = dat,
    endpoint_vars = c("E1","E2","E3","E4"),
    jendpoint = c("E3", "E4"),
    alpha = 0.05,
    nu = 0.6,
    treatment_vars = "treatment",
    method = "ols"
)
#> Number of intersection hypotheses: 31
#> Number of unique intersection hypotheses: 18
#> $F
#> [1] "G"  "H1" "H2" "H3" "H4"
#> 
#> $df
#> # A tibble: 31 × 6
#>    all_Fs all_Fs2   all_ps    nu  zeta alpha_trun
#>    <chr>  <chr>      <dbl> <dbl> <dbl>      <dbl>
#>  1 G      H3&H4    0.0445    0.6   0.4      0.038
#>  2 H1     H1       0.0121    0.6   0.2      0.034
#>  3 H2     H2       0.0142    0.6   0.2      0.034
#>  4 H3     H3       0.199     0.6   0.2      0.034
#>  5 H4     H4       0.0191    0.6   0.2      0.034
#>  6 G&H1   H3&H4&H1 0.0198    0.6   0.6      0.042
#>  7 G&H2   H3&H4&H2 0.0134    0.6   0.6      0.042
#>  8 G&H3   H3&H4    0.0445    0.6   0.4      0.038
#>  9 G&H4   H3&H4    0.0445    0.6   0.4      0.038
#> 10 H1&H2  H1&H2    0.00302   0.6   0.4      0.038
#> # ℹ 21 more rows
#> 
#> $df_gst
#> # A tibble: 5 × 7
#>   F     rej_ob rej_obt  holm hochberg hommel bonferroni
#>   <chr>  <dbl>   <dbl> <dbl>    <dbl>  <dbl>      <dbl>
#> 1 G          1       0     0        0      0          0
#> 2 H1         1       1     0        0      1          0
#> 3 H2         1       1     0        0      1          0
#> 4 H3         0       0     0        0      0          0
#> 5 H4         1       0     0        0      0          0
#> 
#> $alpha_A
#> [1] 0.01777778
#>