testAssoc: testAssoc

View source: R/statTest.R

testAssocR Documentation

testAssoc

Description

Tests for association between two vectors. Based on RnBeads:::test.traits

Usage

testAssoc(x, y, permMat = NULL)

Arguments

x

Sample values for the first trait. This must be a vector of type factor, integer or numeric.

y

Sample values for the second trait. This must be a vector of type factor, integer or numeric.

permMat

Matrix of sample permutations (indices of x that will be used in permutation tests) in case none of the traits is a factor, and thus permutation-based p-value from correlations is computed. If this parameter is NULL and both x and y are sequences of numbers, no p-value is calculated.

Value

List of four elements:

error

Error, if any, that prevented this function from computing a p-value for trait association.

test

Type of test performed. This is one of "Fisher", "Wilcoxon", "Kruskal-Wallis", "Correlation" or NA. The last value indicates that the traits cannot be tested for association.

correlation

Value of the pearson correlation coefficient between x and y, or NA if any of them is factor.

pvalue

Calculated p-value, or NA if the traits cannot be tested for association.


demuellae/muRtools documentation built on Nov. 6, 2024, 9:44 a.m.