Permutation-based FWER control via step-down max-T (Westfall-Young)
Source:R/multiple_testing.R
permutation_fwer.RdGiven observed test statistics and a matrix of test statistics under the permutation null, computes step-down max-T adjusted p-values that strongly control the family-wise error rate without requiring independence across tests.
Usage
permutation_fwer(
test_stats,
null_stats,
alternative = c("two_sided", "greater", "less"),
alpha = 0.05,
labels = NULL
)Arguments
- test_stats
Numeric vector of length \(m\) of observed test statistics.
- null_stats
Numeric matrix with \(n_{perm}\) rows and \(m\) columns containing test statistics computed on permuted data.
- alternative
One of
"two_sided"(default),"greater", or"less".- alpha
Significance level for rejection (default 0.05).
- labels
Optional character vector of test labels.
Value
A morie_rich_result list with original,
adjusted, rejected, method, alpha,
n_rejected, n_tests.
Examples
set.seed(1)
m <- 10; nperm <- 200
obs <- c(rnorm(m - 2), 4.0, 3.5)
null <- matrix(rnorm(nperm * m), nperm, m)
permutation_fwer(obs, null)
#> Adjusted p-values (permutation_maxT)
#> ====================================
#> Call: method=permutation_maxT, alpha=0.0500, n=10
#>
#> Method permutation_maxT
#> alpha 0.05
#> Tests (n) 10
#> Rejected 2
#> Min adjusted p 0
#> Max adjusted p 0.975
#>
#> 2 of 10 hypotheses are rejected at alpha=0.0500. Step-down max-T over 200 permutations.