mine.associations | R Documentation |
Find unusually frequent variable combinations.
mine.associations(x, top = 10, targets = NULL, z = 1)
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. |
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)}
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.
Tom Minka
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.