binarize_matrix: Convert a frequency table (non-negative numeric matrix) to a...

Description Usage Arguments Value

Description

Convert a frequency table (non-negative numeric matrix) to a matrix of the same dimensions containing at each position $(i,j)$ the value $1$ if the selected test statistic meets the provided cutoff threshold and $0$ otherwise. In the case of a chi-squared test, an entry in the result is 1 only if the corresponding entry in the input matrix was greater than expected.

Usage

1
2
3
4
5
binarize_matrix(x, stat, thres, test = NULL)

matrix_chisq(x)

matrix_ratio(x)

Arguments

x

Numeric non-negative matrix.

stat

Character string. The test statistic, either chisq or ratio.

thres

Numeric. The cutoff threshold for the test statistic.

test

Function taking one argument x and giving logical output. If provided, used to determine whether an entry is assigned the value $1$ (if returns TRUE) or $0$ (FALSE).

Value

Binary numeric matrix.


corybrunson/context documentation built on May 13, 2019, 10:52 p.m.