# pairwiselogFC: Compute pairwise log-fold changes In MKmisc: Miscellaneous Functions from M. Kohl

## Description

The function computes pairwise log-fold changes.

## Usage

 `1` ```pairwise.logfc(x, g, ave = mean, log = TRUE, base = 2, ...) ```

## Arguments

 `x` numeric vector. `g` grouping vector or factor `ave` function to compute the group averages. `log` logical. Is the data logarithmic? `base` If `log = TRUE`, the base which was used to compute the logarithms. `...` optional arguments to `ave`.

## Details

The function computes pairwise log-fold changes between groups, where the group values are aggregated using the function which is given by the argument `ave`.

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

## Value

Vector with pairwise log-fold changes.

## Author(s)

Matthias Kohl Matthias.Kohl@stamats.de

`pairwise.t.test`
 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14``` ```set.seed(13) x <- rnorm(100) ## assumed as log2-data g <- factor(sample(1:4, 100, replace = TRUE)) levels(g) <- c("a", "b", "c", "d") pairwise.logfc(x, g) ## some small checks res <- by(x, list(g), mean) res[[1]] - res[[2]] # a vs. b res[[1]] - res[[3]] # a vs. c res[[1]] - res[[4]] # a vs. d res[[2]] - res[[3]] # b vs. c res[[2]] - res[[4]] # b vs. d res[[3]] - res[[4]] # c vs. d ```