Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

chisq_colpairs

Chi-square test on all pairs of columns


Description

Perform a chi-square test for independence for all pairs of columns of a matrix.

Usage

chisq_colpairs(x)

Arguments

x

A matrix of positive integers. NAs and values <= 0 are treated as missing.

Value

A matrix of size p x p, where p is the number of columns in the input matrix x, containing the chi-square test statistics for independence, applied to pairs of columns of x. The diagonal of the result will be all NAs.

Examples

z <- matrix(sample(1:2, 500, replace=TRUE), ncol=5)
chisq_colpairs(z)

qtl2

Quantitative Trait Locus Mapping in Experimental Crosses

v0.24
GPL-3
Authors
Karl W Broman [aut, cre] (<https://orcid.org/0000-0002-4914-6671>), R Core Team [ctb]
Initial release
2020-12-16

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.