Learn R Programming

FDOTT (version 0.1.0)

FDOTT_HSD: Test multiple linear relationships between probability vectors in factorial designs

Description

Perform an optimal transport based HSD test to deal with multiple comparisons simultaneously.

Usage

FDOTT_HSD(test, weights = NULL, group.sizes = TRUE)

Value

A FDOTT_HSD object containing:

p.valuethe \(p\)-values
statisticthe values of the test statistics
null.samplessamples drawn from the null distribution

Arguments

test

a FDOTT object, i.e., output of FDOTT.

weights

weight vector of length \(K\). weights = NULL means that no weights are used. For weights = TRUE the standard weighting is used.

group.sizes

integer vector summing to the number of comparisons \(M\). Used to split the null hypothesis into sub-hypotheses of the specified sizes. The default group.sizes = TRUE extracts these sizes from test. For group.sizes = NULL, each equation is its own group.

Details

Let \(H_0^L : L\mu = 0\) be the null hypothesis of test. In the case of rejection, it is of interest to find out exactly which row-equations are not satisfied with statistical significance. To this end, \(L\mu = 0\) can be split into a number of sub-hypotheses which are tested simultaneously via an approach inspired by Tukey's HSD test, see Groppe et al. (2025) for more details.

References

M. Groppe, L. Niemöller, S. Hundrieser, D. Ventzke, A. Blob, S. Köster and A. Munk (2025). Optimal Transport Based Testing in Factorial Design. arXiv preprint. tools:::Rd_expr_doi("10.48550/arXiv.2509.13970").

See Also

FDOTT

Examples

Run this code

# see FDOTT for more examples

# enable parallel computation
if (requireNamespace("future")) {
    future::plan(future::multisession)
}

K <- 3
N <- 2
costm <- cost_matrix_lp(1:N)

# use higher number to better approximate null distribution and get more accurate p-value
num.sim <- 10

# underlying probability vectors (one-way layout)
# only mu^1 and mu^3 are equal
mu <- matrix(0.5, K, N, TRUE)
mu[2, ] <- c(0.2, 0.8)

n <- c(300, 360, 200)

set.seed(123)
samples <- tab_sample(n, mu)
res <- FDOTT(samples, costm, num.sim = num.sim) |> FDOTT_HSD()
# significant differences for mu^1 = mu^2 and mu^2 = mu^3
print(res)
# \dontshow{
## R CMD check: make sure any open connections are closed afterward
if (requireNamespace("future") && !inherits(future::plan(), "sequential")) future::plan(future::sequential)
# }

Run the code above in your browser using DataLab