mine.associations {mining}R Documentation

Associations in a contingency table

Description

Find unusually frequent variable combinations.

Usage

mine.associations(x,top=10,targets=NULL)

Arguments

x a contingency table
top the number of top associations to return
targets a character vector of table variables, one of which must be included in every returned association.

Details

Enumerates all two-way marginal tables, sorts the cells by lift, and returns the top. The formula for lift is

frac{p(i,j)}{p(i)p(j)}

.

Value

A data frame where the first column is Lift and the remaining columns correspond to the variables of x. Each row describes a cell of x, where marginalized variables have value NA. The lift value describes the ratio of the actual count in the cell versus the expected count under independence.

Author(s)

Tom Minka

Examples

data(Titanic)
mine.associations(Titanic)
# Females are twice as likely to survive as the average person.
# Members of 3rd class are twice as likely to be children as the average person.
# Etc.

# focus on associations with survival
mine.associations(Titanic,target="Survived")

# focus on children
mine.associations(Titanic[,,1,],target="Survived")

[Package Contents]