Learn R Programming

momr (version 1.1)

testRelations: testRelations

Description

This function applies a statistical test either a correlation (spearman, pearson), wilcoxon or t.test as a function of a given phenotype. It will return a matrix of probabilities p and q values along with the correlation coefficient or the enrichment variable when a binary parameter.

Usage

testRelations(data, trait, type, restrict = rep(TRUE, ncol(data)), multiple.adjust = "BH", paired = FALSE, debug = FALSE)

Arguments

data
: frequency matrix with gene_ids in the rownames
trait
: a vector with the trait to test, binary or numerical variable
type
: a character string indicating the type of test to be applied
restrict
: an optional logical vector to select a subset of the samples to perform the test default restrict = rep(TRUE, ncol(data)) ie all the samples are selected
multiple.adjust
: type of multiple adjustment default is "BH" i.e. Benjamini & Hochberg method
paired
: logical with default FALSE wether the test should be paired or not
debug
: default FALSE, when TRUE the progress is printed each 1000 steps

Value

a matrix with analytical results (correlation tests) indicating rho, rho2, p and q values for each parameter tested

Details

testRelations