Skip to contents

Families are tested in order; if a family produces no rejections, subsequent families are blocked from testing. rmorie-specific stage-list return shape; no drop-in CRAN equivalent (gMCP covers the concept but with a different graphical API).

Usage

hierarchical_bonferroni(
  p_values_by_family,
  alpha = 0.05,
  propagate_alpha = TRUE
)

Arguments

p_values_by_family

List of numeric vectors, one per family.

alpha

Overall FWER level.

propagate_alpha

Logical; currently keeps alpha constant across families (mirrors the Python reference).

Value

A morie_rich_result list with one stage entry per family and an overall_rejected logical vector.

Examples

res <- hierarchical_bonferroni(list(c(0.4, 0.5), c(0.001, 0.002)))
str(res)
#> List of 9
#>  $ title           : chr "Hierarchical Bonferroni Gatekeeping"
#>  $ call            : chr "families=2, alpha=0.0500"
#>  $ summary_lines   :List of 4
#>   ..$ Families      : int 2
#>   ..$ alpha         : num 0.05
#>   ..$ Total rejected: int 0
#>   ..$ Gate closed   : logi TRUE
#>  $ warnings        : chr(0) 
#>  $ interpretation  : chr "Serial gatekeeping across 2 famil(ies) with alpha=0.0500 yielded 0 total rejection(s). A downstream gate was cl"| __truncated__
#>  $ stages          :List of 2
#>   ..$ :List of 6
#>   .. ..$ family    : int 1
#>   .. ..$ n_tests   : int 2
#>   .. ..$ alpha_used: num 0.05
#>   .. ..$ n_rejected: int 0
#>   .. ..$ adjusted_p: num [1:2] 0.8 1
#>   .. ..$ rejected  : logi [1:2] FALSE FALSE
#>   ..$ :List of 6
#>   .. ..$ family    : int 2
#>   .. ..$ n_tests   : int 2
#>   .. ..$ alpha_used: num 0
#>   .. ..$ n_rejected: int 0
#>   .. ..$ adjusted_p: num [1:2] 1 1
#>   .. ..$ rejected  : logi [1:2] FALSE FALSE
#>  $ overall_rejected: logi [1:4] FALSE FALSE FALSE FALSE
#>  $ method          : chr "hierarchical_bonferroni"
#>  $ alpha           : num 0.05
#>  - attr(*, "class")= chr [1:3] "morie_multiple_testing_result" "morie_rich_result" "list"