pairwiseFun: Compute pairwise values for a given function

pairwise.funR Documentation

Compute pairwise values for a given function

Description

The function computes pairwise values for a given function.

Usage

pairwise.fun(x, g, fun, ...)

Arguments

x

numeric vector.

g

grouping vector or factor

fun

some function where the first two arguments have to be numeric vectors for which the function computes some quantity; see example section below.

...

additional arguments to fun.

Details

The function computes pairwise values for a given function.

The implementation is in certain aspects analogously to pairwise.t.test.

Value

Vector with pairwise function values.

Author(s)

Matthias Kohl Matthias.Kohl@stamats.de

See Also

pairwise.t.test, pairwise.fc, pairwise.logfc, pairwise.auc

Examples

set.seed(13)
x <- rnorm(100)
g <- factor(sample(1:4, 100, replace = TRUE))
levels(g) <- c("a", "b", "c", "d")
pairwise.fun(x, g, fun = function(x, y) t.test(x,y)$p.value)
## in contrast to
pairwise.t.test(x, g, p.adjust.method = "none", pool.sd = FALSE)

stamats/MKmisc documentation built on Nov. 20, 2022, 6:06 a.m.