cramerV {shiftR}R Documentation

Calculate Cramer's V (phi) Coefficient

Description

This functions calculates Cramer's V coefficient for overlap of two binary data sets.

Usage

cramerV(sum12, sum1, sum2, len)

Arguments

len

Total number of elements in each data set.

sum1

Number of active features in data set 1.

sum2

Number of active features in data set 1.

sum12

Number of simultaneously active features in the data sets.

Value

Returns the Cramer's V coefficient.

Note

The parameters can be single values or vectors.

Author(s)

Andrey A Shabalin andrey.shabalin@gmail.com

Examples

# Zero score for perfect independence
cramerV(100,10000,10000,1000000)

# Positive score for increased overlap
cramerV(150,10000,10000,1000000)

# Negative score for decreased overlap
cramerV( 50,10000,10000,1000000)

# We can input a vector for sum12
cramerV(99:101,10000,10000,1000000)

[Package shiftR version 1.5 Index]