DA.fri: Friedman Rank Sum test

View source: R/DA.fri.R

DA.friR Documentation

Friedman Rank Sum test

Description

Apply friedman test to multiple features with one predictor

Usage

DA.fri(
  data,
  predictor,
  paired = NULL,
  relative = TRUE,
  p.adj = "fdr",
  allResults = FALSE,
  ...
)

Arguments

data

Either a matrix with counts/abundances, OR a phyloseq object. If a matrix/data.frame is provided rows should be taxa/genes/proteins and columns samples

predictor

The predictor of interest. Factor, OR if data is a phyloseq object the name of the variable in sample_data(data) in quotation

paired

For paired/blocked experimental designs. Either a Factor with Subject/Block ID for running paired/blocked analysis, OR if data is a phyloseq object the name of the variable in sample_data(data) in quotation

relative

Logical. Should data be normalized to relative abundances. Default TRUE

p.adj

Character. P-value adjustment. Default "fdr". See p.adjust for details

allResults

If TRUE will return raw results from the friedman.test function

...

Additional arguments for the friedman.test function

Value

A data.frame with with results.

Examples

# Creating random count_table, predictor, and paired variable
set.seed(4)
mat <- matrix(rnbinom(1500, size = 0.1, mu = 500), nrow = 100, ncol = 15)
rownames(mat) <- 1:100
pred <- c(rep("A", 5), rep("B", 5), rep("C", 5))
subject <- rep(1:5, 3)

# Running Friedman test on each feature
res <- DA.fri(data = mat, predictor = pred, paired = subject)

Russel88/DAtest documentation built on March 24, 2022, 3:50 p.m.