cat.dist: Distance for a Categorical Variable

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/cat.dist.R

Description

A function to calculate the distance for a categorical variable.

Usage

1

Arguments

X

vector of category designations

Details

This function calculates distance function for a categorical variable. The result is a square n by n matrix in which entry (i,j) has value 1 if entry i and entry j of the input vector X are not equal and entry (i,j) of the result matrix has value 0 if entry i and entry j of the input vector are equal. The distance between subject i and subject j is zero if the two subjects have the same categorical designation. The distance between subject i and subject j is one if the two subjects do not have the same categorical designation.

Value

A square matrix with each dimension equal to the length of X.

Author(s)

Xueyuan Cao xcao12@uthsc.edu and Stanley Pounds stanley.pounds@stjude.org

References

Cao X and Pounds S (2021) Gene-Set Distance Associations (GSDA): A Powerful Tool for Gene-Set Association Analysis.

See Also

surv.dist

Examples

1
2
3
data(target.aml.clin)
cd=cat.dist(target.aml.clin$Chloroma)
cd[1:5,1:5]

GSDA documentation built on Jan. 18, 2021, 5:05 p.m.