test_between_factors: Test whether a list of factors are correlated

Description Usage Arguments Details Value Author(s) Examples

View source: R/test_with_known.R

Description

Test whether a list of factors are correlated

Usage

1
test_between_factors(x, y = NULL, all_factors = FALSE, verbose = FALSE)

Arguments

x

A data frame or a vector which contains discrete or continuous variables. if y is omit, pairwise testing for all columns in x is performed.

y

A data frame or a vector which contains discrete or continuous variables.

all_factors

Are all columns in x and y enforced to be factors?

verbose

Whether to print messages.

Details

Pairwise test is applied to every two columns in the data frames. Methods are:

This function can be used to test the correlation between the predicted classes and other known factors.

Value

A matrix of p-values. If there are NA values, basically it means there are no efficient data points to perform the test.

Author(s)

Zuguang Gu <z.gu@dkfz.de>

Examples

1
2
3
4
5
6
7
8
df = data.frame(
    v1 = rnorm(100), 
    v2 = sample(letters[1:3], 100, replace = TRUE), 
    v3 = sample(LETTERS[5:6], 100, replace = TRUE)
)
test_between_factors(df)
x = runif(100)
test_between_factors(x, df)

cola documentation built on Nov. 8, 2020, 8:12 p.m.