gktau {microbiome} | R Documentation

## gktau

### Description

Measure association between nominal (no order for levels) variables

### Usage

    gktau(x, y)

### Arguments

`x` | first variable
`y` | second variable

### Details

Measure association between nominal (no order for levels) variables using Goodman and Kruskal tau. Code modified from the original source: r-bloggers.com/measuring-associations-between-non-numeric-variables/ An important feature of this procedure is that it allows missing values in either of the variables x or y, treating 'missing' as an additional level. In practice, this is sometimes very important since missing values in one variable may be strongly associated with either missing values in another variable or specific non-missing levels of that variable. An important characteristic of Goodman and Kruskal's tau measure is its asymmetry: because the variables x and y enter this expression differently, the value of a(y,x) is not the same as the value of a(x, y), in general. This stands in marked contrast to either the product-moment correlation coefficient or the Spearman rank correlation coefficient, which are both symmetric, giving the same association between x and y as that between y and x. The fundamental reason for the asymmetry of the general class of measures defined above is that they quantify the extent to which the variable x is useful in predicting y, which may be very different than the extent to which the variable y is useful in predicting x.

### Value

Dependency measure

### Author(s)

Contact: Leo Lahti microbiome-admin@googlegroups.com

### References

Code modified from the original source: http://r-bloggers.com/measuring-associations-between-non-numeric-variables/ To cite the microbiome R package, see citation('microbiome')

### Examples

    data(peerj32)
    v1 <- unlist(peerj32$microbes[,1])
    v2 <- unlist(peerj32$lipids[,1])
    tc <- gktau(v1, v2)

[Package microbiome version 1.12.0 Index]