is.significant: Find Significant Rules

Description Usage Arguments Value Author(s) See Also Examples

Description

Provides the generic functions and the S4 method is.significant to find rules where the LHS and the RHS depend on each other. This uses Fisher's exact test and corrects for multiple comparisons.

Usage

1
2
is.significant(x, transactions, method = "fisher", 
  alpha = 0.01, adjust = "bonferroni") 

Arguments

x

a set of rules.

transactions

set of transactions used to mine the rules.

method

test to use. Options are "fisher", "chisq". Note that the contingency table is likely to have cells with low expected values and that thus Fisher's Exact Test might be more appropriate than the chi-squared test.

alpha

required significance level.

adjust

method to adjust for multiple comparisons. Options are "none", "bonferroni", "holm", "fdr", etc. (see p.adjust)

Value

returns a logical vector indicating which rules are significant.

Author(s)

Michael Hahsler

See Also

interestMeasure, p.adjust

Examples

1
2
3
4
5

Example output

Loading required package: Matrix

Attaching package: 'arules'

The following objects are masked from 'package:base':

    abbreviate, write

Apriori

Parameter specification:
 confidence minval smax arem  aval originalSupport maxtime support minlen
        0.8    0.1    1 none FALSE            TRUE       5     0.5      1
 maxlen target   ext
     10  rules FALSE

Algorithmic control:
 filter tree heap memopt load sort verbose
    0.1 TRUE TRUE  FALSE TRUE    2    TRUE

Absolute minimum support count: 3438 

set item appearances ...[0 item(s)] done [0.00s].
set transactions ...[50 item(s), 6876 transaction(s)] done [0.00s].
sorting and recoding items ... [11 item(s)] done [0.00s].
creating transaction tree ... done [0.00s].
checking subsets of size 1 2 3 done [0.00s].
writing ... [16 rule(s)] done [0.00s].
creating S4 object  ... done [0.00s].
 [1] FALSE  TRUE FALSE FALSE FALSE  TRUE  TRUE  TRUE FALSE  TRUE  TRUE  TRUE
[13] FALSE  TRUE  TRUE  TRUE
     lhs                              rhs                               support confidence     lift
[1]  {sex=female}                  => {language in home=english}      0.5122164  0.9246521 1.012890
[2]  {number of children=0}        => {number in household=1}         0.5532286  0.8896165 1.285895
[3]  {number of children=0}        => {language in home=english}      0.5801338  0.9328812 1.021904
[4]  {income=$0-$40,000}           => {education=no college graduate} 0.5018906  0.8063084 1.143365
[5]  {years in bay area=10+}       => {language in home=english}      0.6013671  0.9300495 1.018802
[6]  {ethnic classification=white} => {language in home=english}      0.6595404  0.9847991 1.078776
[7]  {number in household=1}       => {language in home=english}      0.6495055  0.9388270 1.028417
[8]  {number in household=1,                                                                       
      number of children=0}        => {language in home=english}      0.5213787  0.9424290 1.032363
[9]  {number of children=0,                                                                        
      language in home=english}    => {number in household=1}         0.5213787  0.8987215 1.299056
[10] {number in household=1,                                                                       
      language in home=english}    => {number of children=0}          0.5213787  0.8027318 1.290829

arules documentation built on Sept. 2, 2017, 1:09 a.m.