Association Rules - Life in L.A. <a name=top></a>

In this notebook, you will apply association rules mining to the Life in L.A. dataset.

The dataset consists of 16 observations, each item having 8 variables. Our goal here is to find the combination of items that occur with certain frequency, and find item-sets that provide insights to the structure of data

TUTORIAL OUTLINE

  1. Load and Explore Data
  2. Explore Data With arules
  3. Visualizing Association Rules
  4. Exercise
  5. Other References

Back to top

1. LOAD AND EXPLORE DATA <a name=load></a>

The very fisrt step in programming with R is to import data. Then we perform a few routines to explore the structure of data.

In [1]:
life.in.LA <- read.csv("Data/turner_life_in_LA.csv", head=TRUE)

head(life.in.LA) # look at data (first 6 rows)
str(life.in.LA) # investigate types of variables; other than lon & lat, features seem to be "categorical"
summary(life.in.LA) # provides 6-point summary for each variable
lonlataffluenceunemploymenturban.stressprop.whitelon.classlat.class
183 104 2 2 1 1 West North
329 155 2 2 1 1 CentralNorth
87 183 1 2 1 1 West North
154 184 2 2 1 1 West North
224 225 2 2 1 1 CentralNorth
139 266 1 1 1 1 West Central
'data.frame':	16 obs. of  8 variables:
 $ lon         : int  183 329 87 154 224 139 156 222 352 433 ...
 $ lat         : int  104 155 183 184 225 266 335 312 304 320 ...
 $ affluence   : int  2 2 1 2 2 1 1 1 3 3 ...
 $ unemployment: int  2 2 2 2 2 1 1 1 2 2 ...
 $ urban.stress: int  1 1 1 1 1 1 1 2 2 2 ...
 $ prop.white  : int  1 1 1 1 1 1 1 1 1 1 ...
 $ lon.class   : Factor w/ 3 levels "Central","East",..: 3 1 3 3 1 3 3 1 2 2 ...
 $ lat.class   : Factor w/ 3 levels "Central","North",..: 2 2 2 2 2 1 1 1 1 1 ...
      lon             lat          affluence      unemployment    urban.stress
 Min.   : 87.0   Min.   :104.0   Min.   :1.000   Min.   :1.000   Min.   :1.0  
 1st Qu.:176.2   1st Qu.:214.8   1st Qu.:1.750   1st Qu.:1.750   1st Qu.:1.0  
 Median :248.5   Median :316.0   Median :2.000   Median :2.000   Median :1.0  
 Mean   :264.0   Mean   :316.8   Mean   :2.125   Mean   :1.938   Mean   :1.5  
 3rd Qu.:352.8   3rd Qu.:382.0   3rd Qu.:3.000   3rd Qu.:2.000   3rd Qu.:2.0  
 Max.   :433.0   Max.   :634.0   Max.   :3.000   Max.   :3.000   Max.   :3.0  
   prop.white      lon.class   lat.class
 Min.   :1.000   Central:6   Central:6  
 1st Qu.:1.000   East   :5   North  :5  
 Median :1.000   West   :5   South  :5  
 Mean   :1.188                          
 3rd Qu.:1.000                          
 Max.   :3.000                          

Back to top

2. EXPLORING DATA WITH arules<a name=arules></a>

In previous section, we learned that variables $affluence$, $unemployment$, $urban.stress$, and $prop.white$, are technically categorical variables. We will convert these integer values to categories by function called lapply. Then we use a function called apriori, which returns the all possible $rules$ ($itemset$).<br><br> By default, apriori creates rules with minimum support of $0.1$, minimum confidence of $0.8$, and maximum of $10$ items. <br>

$\textbf{NOTE:}$ Since apriori is a function within a package called arules, we must load the library beforehand.

In [2]:
library(arules)

(life.in.LA[,c(3,4,5,6)] <- lapply(life.in.LA[,c(3,4,5,6)] , factor)) # Categorizes variables 3 to 6

# find association rules with default settings
rules.LA <- apriori(life.in.LA[,3:8])
Loading required package: Matrix

Attaching package: ‘arules’

The following objects are masked from ‘package:base’:

    abbreviate, write

$affluence
  1. 2
  2. 2
  3. 1
  4. 2
  5. 2
  6. 1
  7. 1
  8. 1
  9. 3
  10. 3
  11. 2
  12. 3
  13. 3
  14. 3
  15. 2
  16. 3
$unemployment
  1. 2
  2. 2
  3. 2
  4. 2
  5. 2
  6. 1
  7. 1
  8. 1
  9. 2
  10. 2
  11. 3
  12. 1
  13. 3
  14. 3
  15. 2
  16. 2
$urban.stress
  1. 1
  2. 1
  3. 1
  4. 1
  5. 1
  6. 1
  7. 1
  8. 2
  9. 2
  10. 2
  11. 1
  12. 2
  13. 3
  14. 2
  15. 1
  16. 2
$prop.white
  1. 1
  2. 1
  3. 1
  4. 1
  5. 1
  6. 1
  7. 1
  8. 1
  9. 1
  10. 1
  11. 1
  12. 1
  13. 2
  14. 3
  15. 1
  16. 1
Apriori

Parameter specification:
 confidence minval smax arem  aval originalSupport maxtime support minlen
        0.8    0.1    1 none FALSE            TRUE       5     0.1      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: 1 

set item appearances ...[0 item(s)] done [0.00s].
set transactions ...[18 item(s), 16 transaction(s)] done [0.00s].
sorting and recoding items ... [15 item(s)] done [0.00s].
creating transaction tree ... done [0.00s].
checking subsets of size 1 2 3 4 5 6 done [0.00s].
writing ... [444 rule(s)] done [0.00s].
creating S4 object  ... done [0.00s].

For a rule $X \to Y$, arules computes the following metrics:

  • $\text{Support}(X\to Y) = \frac{\text{Freq}(X,Y)}{N}$
  • $\text{Confidence}(X\to Y) = \frac{\text{Freq}(X,Y)}{\text{Freq}(X)}$
  • $\text{Lift}(X\to Y) = \frac{N^2 \times \text{Support}(X\to Y)}{\text{Freq}(X) \times \text{Freq}(Y)}$

The higher these values, the better.


The following function inspect returns a list of all rules created by apriori. Using the default setting, the list consists of $444$ rules (which is quite lengthy... it looks like the default setting is very lenient).

In [3]:
inspect(rules.LA)
      lhs                    rhs                 support confidence      lift
[1]   {}                  => {prop.white=1}       0.8750  0.8750000 1.0000000
[2]   {unemployment=3}    => {lat.class=South}    0.1875  1.0000000 3.2000000
[3]   {affluence=1}       => {prop.white=1}       0.2500  1.0000000 1.1428571
[4]   {unemployment=1}    => {lat.class=Central}  0.2500  1.0000000 2.6666667
[5]   {unemployment=1}    => {prop.white=1}       0.2500  1.0000000 1.1428571
[6]   {lon.class=East}    => {affluence=3}        0.3125  1.0000000 2.6666667
[7]   {affluence=3}       => {lon.class=East}     0.3125  0.8333333 2.6666667
[8]   {lon.class=East}    => {urban.stress=2}     0.2500  0.8000000 2.1333333
[9]   {lon.class=West}    => {urban.stress=1}     0.3125  1.0000000 1.7777778
[10]  {lon.class=West}    => {prop.white=1}       0.3125  1.0000000 1.1428571
[11]  {lat.class=North}   => {affluence=2}        0.2500  0.8000000 2.1333333
[12]  {lat.class=North}   => {urban.stress=1}     0.3125  1.0000000 1.7777778
[13]  {lat.class=North}   => {unemployment=2}     0.3125  1.0000000 1.7777778
[14]  {lat.class=North}   => {prop.white=1}       0.3125  1.0000000 1.1428571
[15]  {affluence=2}       => {urban.stress=1}     0.3750  1.0000000 1.7777778
[16]  {affluence=2}       => {unemployment=2}     0.3125  0.8333333 1.4814815
[17]  {affluence=2}       => {prop.white=1}       0.3750  1.0000000 1.1428571
[18]  {affluence=3}       => {urban.stress=2}     0.3125  0.8333333 2.2222222
[19]  {urban.stress=2}    => {affluence=3}        0.3125  0.8333333 2.2222222
[20]  {urban.stress=2}    => {prop.white=1}       0.3125  0.8333333 0.9523810
[21]  {lat.class=Central} => {prop.white=1}       0.3750  1.0000000 1.1428571
[22]  {lon.class=Central} => {prop.white=1}       0.3750  1.0000000 1.1428571
[23]  {urban.stress=1}    => {prop.white=1}       0.5625  1.0000000 1.1428571
[24]  {unemployment=2}    => {prop.white=1}       0.5625  1.0000000 1.1428571
[25]  {unemployment=3,                                                       
       lon.class=East}    => {lat.class=South}    0.1250  1.0000000 3.2000000
[26]  {affluence=3,                                                          
       unemployment=3}    => {lat.class=South}    0.1250  1.0000000 3.2000000
[27]  {unemployment=3,                                                       
       lon.class=East}    => {affluence=3}        0.1250  1.0000000 2.6666667
[28]  {affluence=3,                                                          
       unemployment=3}    => {lon.class=East}     0.1250  1.0000000 3.2000000
[29]  {unemployment=1,                                                       
       lon.class=West}    => {affluence=1}        0.1250  1.0000000 4.0000000
[30]  {affluence=1,                                                          
       unemployment=1}    => {lat.class=Central}  0.1875  1.0000000 2.6666667
[31]  {affluence=1,                                                          
       lat.class=Central} => {unemployment=1}     0.1875  1.0000000 4.0000000
[32]  {unemployment=1,                                                       
       urban.stress=1}    => {affluence=1}        0.1250  1.0000000 4.0000000
[33]  {affluence=1,                                                          
       unemployment=1}    => {prop.white=1}       0.1875  1.0000000 1.1428571
[34]  {lon.class=West,                                                       
       lat.class=Central} => {affluence=1}        0.1250  1.0000000 4.0000000
[35]  {affluence=1,                                                          
       lon.class=West}    => {urban.stress=1}     0.1875  1.0000000 1.7777778
[36]  {affluence=1,                                                          
       urban.stress=1}    => {lon.class=West}     0.1875  1.0000000 3.2000000
[37]  {affluence=1,                                                          
       lon.class=West}    => {prop.white=1}       0.1875  1.0000000 1.1428571
[38]  {urban.stress=1,                                                       
       lat.class=Central} => {affluence=1}        0.1250  1.0000000 4.0000000
[39]  {affluence=1,                                                          
       lat.class=Central} => {prop.white=1}       0.1875  1.0000000 1.1428571
[40]  {affluence=1,                                                          
       urban.stress=1}    => {prop.white=1}       0.1875  1.0000000 1.1428571
[41]  {unemployment=1,                                                       
       lon.class=West}    => {lat.class=Central}  0.1250  1.0000000 2.6666667
[42]  {lon.class=West,                                                       
       lat.class=Central} => {unemployment=1}     0.1250  1.0000000 4.0000000
[43]  {unemployment=1,                                                       
       lon.class=West}    => {urban.stress=1}     0.1250  1.0000000 1.7777778
[44]  {unemployment=1,                                                       
       urban.stress=1}    => {lon.class=West}     0.1250  1.0000000 3.2000000
[45]  {unemployment=1,                                                       
       lon.class=West}    => {prop.white=1}       0.1250  1.0000000 1.1428571
[46]  {unemployment=1,                                                       
       urban.stress=2}    => {lat.class=Central}  0.1250  1.0000000 2.6666667
[47]  {unemployment=1,                                                       
       urban.stress=2}    => {lon.class=Central}  0.1250  1.0000000 2.6666667
[48]  {unemployment=1,                                                       
       lon.class=Central} => {urban.stress=2}     0.1250  1.0000000 2.6666667
[49]  {urban.stress=2,                                                       
       lon.class=Central} => {unemployment=1}     0.1250  1.0000000 4.0000000
[50]  {unemployment=1,                                                       
       urban.stress=2}    => {prop.white=1}       0.1250  1.0000000 1.1428571
[51]  {unemployment=1,                                                       
       lon.class=Central} => {lat.class=Central}  0.1250  1.0000000 2.6666667
[52]  {lon.class=Central,                                                    
       lat.class=Central} => {unemployment=1}     0.1250  1.0000000 4.0000000
[53]  {unemployment=1,                                                       
       urban.stress=1}    => {lat.class=Central}  0.1250  1.0000000 2.6666667
[54]  {urban.stress=1,                                                       
       lat.class=Central} => {unemployment=1}     0.1250  1.0000000 4.0000000
[55]  {unemployment=1,                                                       
       lat.class=Central} => {prop.white=1}       0.2500  1.0000000 1.1428571
[56]  {unemployment=1,                                                       
       prop.white=1}      => {lat.class=Central}  0.2500  1.0000000 2.6666667
[57]  {unemployment=1,                                                       
       lon.class=Central} => {prop.white=1}       0.1250  1.0000000 1.1428571
[58]  {unemployment=1,                                                       
       urban.stress=1}    => {prop.white=1}       0.1250  1.0000000 1.1428571
[59]  {lon.class=East,                                                       
       lat.class=South}   => {affluence=3}        0.1875  1.0000000 2.6666667
[60]  {affluence=3,                                                          
       lat.class=South}   => {lon.class=East}     0.1875  1.0000000 3.2000000
[61]  {urban.stress=2,                                                       
       lat.class=South}   => {lon.class=East}     0.1250  1.0000000 3.2000000
[62]  {affluence=2,                                                          
       lat.class=South}   => {lon.class=Central}  0.1250  1.0000000 2.6666667
[63]  {lon.class=Central,                                                    
       lat.class=South}   => {affluence=2}        0.1250  1.0000000 2.6666667
[64]  {affluence=2,                                                          
       lat.class=South}   => {urban.stress=1}     0.1250  1.0000000 1.7777778
[65]  {urban.stress=1,                                                       
       lat.class=South}   => {affluence=2}        0.1250  1.0000000 2.6666667
[66]  {affluence=2,                                                          
       lat.class=South}   => {prop.white=1}       0.1250  1.0000000 1.1428571
[67]  {urban.stress=2,                                                       
       lat.class=South}   => {affluence=3}        0.1250  1.0000000 2.6666667
[68]  {lon.class=Central,                                                    
       lat.class=South}   => {urban.stress=1}     0.1250  1.0000000 1.7777778
[69]  {urban.stress=1,                                                       
       lat.class=South}   => {lon.class=Central}  0.1250  1.0000000 2.6666667
[70]  {lon.class=Central,                                                    
       lat.class=South}   => {prop.white=1}       0.1250  1.0000000 1.1428571
[71]  {urban.stress=1,                                                       
       lat.class=South}   => {prop.white=1}       0.1250  1.0000000 1.1428571
[72]  {unemployment=2,                                                       
       lat.class=South}   => {prop.white=1}       0.1250  1.0000000 1.1428571
[73]  {affluence=3,                                                          
       lon.class=East}    => {urban.stress=2}     0.2500  0.8000000 2.1333333
[74]  {urban.stress=2,                                                       
       lon.class=East}    => {affluence=3}        0.2500  1.0000000 2.6666667
[75]  {affluence=3,                                                          
       urban.stress=2}    => {lon.class=East}     0.2500  0.8000000 2.5600000
[76]  {lon.class=East,                                                       
       lat.class=Central} => {affluence=3}        0.1250  1.0000000 2.6666667
[77]  {unemployment=2,                                                       
       lon.class=East}    => {affluence=3}        0.1875  1.0000000 2.6666667
[78]  {affluence=3,                                                          
       unemployment=2}    => {lon.class=East}     0.1875  1.0000000 3.2000000
[79]  {prop.white=1,                                                         
       lon.class=East}    => {affluence=3}        0.1875  1.0000000 2.6666667
[80]  {lon.class=East,                                                       
       lat.class=Central} => {urban.stress=2}     0.1250  1.0000000 2.6666667
[81]  {unemployment=2,                                                       
       lon.class=East}    => {urban.stress=2}     0.1875  1.0000000 2.6666667
[82]  {unemployment=2,                                                       
       urban.stress=2}    => {lon.class=East}     0.1875  1.0000000 3.2000000
[83]  {prop.white=1,                                                         
       lon.class=East}    => {urban.stress=2}     0.1875  1.0000000 2.6666667
[84]  {lon.class=East,                                                       
       lat.class=Central} => {unemployment=2}     0.1250  1.0000000 1.7777778
[85]  {unemployment=2,                                                       
       lat.class=Central} => {lon.class=East}     0.1250  1.0000000 3.2000000
[86]  {lon.class=East,                                                       
       lat.class=Central} => {prop.white=1}       0.1250  1.0000000 1.1428571
[87]  {unemployment=2,                                                       
       lon.class=East}    => {prop.white=1}       0.1875  1.0000000 1.1428571
[88]  {prop.white=1,                                                         
       lon.class=East}    => {unemployment=2}     0.1875  1.0000000 1.7777778
[89]  {affluence=2,                                                          
       lon.class=West}    => {lat.class=North}    0.1250  1.0000000 3.2000000
[90]  {lon.class=West,                                                       
       lat.class=North}   => {urban.stress=1}     0.1875  1.0000000 1.7777778
[91]  {lon.class=West,                                                       
       lat.class=North}   => {unemployment=2}     0.1875  1.0000000 1.7777778
[92]  {unemployment=2,                                                       
       lon.class=West}    => {lat.class=North}    0.1875  1.0000000 3.2000000
[93]  {lon.class=West,                                                       
       lat.class=North}   => {prop.white=1}       0.1875  1.0000000 1.1428571
[94]  {affluence=2,                                                          
       lon.class=West}    => {urban.stress=1}     0.1250  1.0000000 1.7777778
[95]  {affluence=2,                                                          
       lon.class=West}    => {unemployment=2}     0.1250  1.0000000 1.7777778
[96]  {affluence=2,                                                          
       lon.class=West}    => {prop.white=1}       0.1250  1.0000000 1.1428571
[97]  {lon.class=West,                                                       
       lat.class=Central} => {urban.stress=1}     0.1250  1.0000000 1.7777778
[98]  {urban.stress=1,                                                       
       lat.class=Central} => {lon.class=West}     0.1250  1.0000000 3.2000000
[99]  {lon.class=West,                                                       
       lat.class=Central} => {prop.white=1}       0.1250  1.0000000 1.1428571
[100] {unemployment=2,                                                       
       lon.class=West}    => {urban.stress=1}     0.1875  1.0000000 1.7777778
[101] {urban.stress=1,                                                       
       lon.class=West}    => {prop.white=1}       0.3125  1.0000000 1.1428571
[102] {prop.white=1,                                                         
       lon.class=West}    => {urban.stress=1}     0.3125  1.0000000 1.7777778
[103] {unemployment=2,                                                       
       lon.class=West}    => {prop.white=1}       0.1875  1.0000000 1.1428571
[104] {lon.class=Central,                                                    
       lat.class=North}   => {affluence=2}        0.1250  1.0000000 2.6666667
[105] {affluence=2,                                                          
       lat.class=North}   => {urban.stress=1}     0.2500  1.0000000 1.7777778
[106] {urban.stress=1,                                                       
       lat.class=North}   => {affluence=2}        0.2500  0.8000000 2.1333333
[107] {affluence=2,                                                          
       lat.class=North}   => {unemployment=2}     0.2500  1.0000000 1.7777778
[108] {unemployment=2,                                                       
       lat.class=North}   => {affluence=2}        0.2500  0.8000000 2.1333333
[109] {affluence=2,                                                          
       unemployment=2}    => {lat.class=North}    0.2500  0.8000000 2.5600000
[110] {affluence=2,                                                          
       lat.class=North}   => {prop.white=1}       0.2500  1.0000000 1.1428571
[111] {prop.white=1,                                                         
       lat.class=North}   => {affluence=2}        0.2500  0.8000000 2.1333333
[112] {lon.class=Central,                                                    
       lat.class=North}   => {urban.stress=1}     0.1250  1.0000000 1.7777778
[113] {lon.class=Central,                                                    
       lat.class=North}   => {unemployment=2}     0.1250  1.0000000 1.7777778
[114] {lon.class=Central,                                                    
       lat.class=North}   => {prop.white=1}       0.1250  1.0000000 1.1428571
[115] {urban.stress=1,                                                       
       lat.class=North}   => {unemployment=2}     0.3125  1.0000000 1.7777778
[116] {unemployment=2,                                                       
       lat.class=North}   => {urban.stress=1}     0.3125  1.0000000 1.7777778
[117] {unemployment=2,                                                       
       urban.stress=1}    => {lat.class=North}    0.3125  0.8333333 2.6666667
[118] {urban.stress=1,                                                       
       lat.class=North}   => {prop.white=1}       0.3125  1.0000000 1.1428571
[119] {prop.white=1,                                                         
       lat.class=North}   => {urban.stress=1}     0.3125  1.0000000 1.7777778
[120] {unemployment=2,                                                       
       lat.class=North}   => {prop.white=1}       0.3125  1.0000000 1.1428571
[121] {prop.white=1,                                                         
       lat.class=North}   => {unemployment=2}     0.3125  1.0000000 1.7777778
[122] {affluence=2,                                                          
       lon.class=Central} => {urban.stress=1}     0.2500  1.0000000 1.7777778
[123] {urban.stress=1,                                                       
       lon.class=Central} => {affluence=2}        0.2500  1.0000000 2.6666667
[124] {unemployment=2,                                                       
       lon.class=Central} => {affluence=2}        0.1875  1.0000000 2.6666667
[125] {affluence=2,                                                          
       lon.class=Central} => {prop.white=1}       0.2500  1.0000000 1.1428571
[126] {affluence=2,                                                          
       urban.stress=1}    => {unemployment=2}     0.3125  0.8333333 1.4814815
[127] {affluence=2,                                                          
       unemployment=2}    => {urban.stress=1}     0.3125  1.0000000 1.7777778
[128] {unemployment=2,                                                       
       urban.stress=1}    => {affluence=2}        0.3125  0.8333333 2.2222222
[129] {affluence=2,                                                          
       urban.stress=1}    => {prop.white=1}       0.3750  1.0000000 1.1428571
[130] {affluence=2,                                                          
       prop.white=1}      => {urban.stress=1}     0.3750  1.0000000 1.7777778
[131] {affluence=2,                                                          
       unemployment=2}    => {prop.white=1}       0.3125  1.0000000 1.1428571
[132] {affluence=2,                                                          
       prop.white=1}      => {unemployment=2}     0.3125  0.8333333 1.4814815
[133] {affluence=3,                                                          
       lat.class=Central} => {urban.stress=2}     0.1875  1.0000000 2.6666667
[134] {affluence=3,                                                          
       unemployment=2}    => {urban.stress=2}     0.1875  1.0000000 2.6666667
[135] {unemployment=2,                                                       
       urban.stress=2}    => {affluence=3}        0.1875  1.0000000 2.6666667
[136] {affluence=3,                                                          
       urban.stress=2}    => {prop.white=1}       0.2500  0.8000000 0.9142857
[137] {affluence=3,                                                          
       prop.white=1}      => {urban.stress=2}     0.2500  1.0000000 2.6666667
[138] {urban.stress=2,                                                       
       prop.white=1}      => {affluence=3}        0.2500  0.8000000 2.1333333
[139] {unemployment=2,                                                       
       lat.class=Central} => {affluence=3}        0.1250  1.0000000 2.6666667
[140] {affluence=3,                                                          
       lat.class=Central} => {prop.white=1}       0.1875  1.0000000 1.1428571
[141] {affluence=3,                                                          
       unemployment=2}    => {prop.white=1}       0.1875  1.0000000 1.1428571
[142] {urban.stress=2,                                                       
       lon.class=Central} => {lat.class=Central}  0.1250  1.0000000 2.6666667
[143] {lon.class=Central,                                                    
       lat.class=Central} => {urban.stress=2}     0.1250  1.0000000 2.6666667
[144] {unemployment=2,                                                       
       lat.class=Central} => {urban.stress=2}     0.1250  1.0000000 2.6666667
[145] {urban.stress=2,                                                       
       lat.class=Central} => {prop.white=1}       0.2500  1.0000000 1.1428571
[146] {urban.stress=2,                                                       
       prop.white=1}      => {lat.class=Central}  0.2500  0.8000000 2.1333333
[147] {urban.stress=2,                                                       
       lon.class=Central} => {prop.white=1}       0.1250  1.0000000 1.1428571
[148] {unemployment=2,                                                       
       urban.stress=2}    => {prop.white=1}       0.1875  1.0000000 1.1428571
[149] {lon.class=Central,                                                    
       lat.class=Central} => {prop.white=1}       0.1250  1.0000000 1.1428571
[150] {urban.stress=1,                                                       
       lat.class=Central} => {prop.white=1}       0.1250  1.0000000 1.1428571
[151] {unemployment=2,                                                       
       lat.class=Central} => {prop.white=1}       0.1250  1.0000000 1.1428571
[152] {unemployment=2,                                                       
       lon.class=Central} => {urban.stress=1}     0.1875  1.0000000 1.7777778
[153] {urban.stress=1,                                                       
       lon.class=Central} => {prop.white=1}       0.2500  1.0000000 1.1428571
[154] {unemployment=2,                                                       
       lon.class=Central} => {prop.white=1}       0.1875  1.0000000 1.1428571
[155] {unemployment=2,                                                       
       urban.stress=1}    => {prop.white=1}       0.3750  1.0000000 1.1428571
[156] {unemployment=3,                                                       
       lon.class=East,                                                       
       lat.class=South}   => {affluence=3}        0.1250  1.0000000 2.6666667
[157] {affluence=3,                                                          
       unemployment=3,                                                       
       lat.class=South}   => {lon.class=East}     0.1250  1.0000000 3.2000000
[158] {affluence=3,                                                          
       unemployment=3,                                                       
       lon.class=East}    => {lat.class=South}    0.1250  1.0000000 3.2000000
[159] {affluence=1,                                                          
       unemployment=1,                                                       
       lon.class=West}    => {lat.class=Central}  0.1250  1.0000000 2.6666667
[160] {affluence=1,                                                          
       lon.class=West,                                                       
       lat.class=Central} => {unemployment=1}     0.1250  1.0000000 4.0000000
[161] {unemployment=1,                                                       
       lon.class=West,                                                       
       lat.class=Central} => {affluence=1}        0.1250  1.0000000 4.0000000
[162] {affluence=1,                                                          
       unemployment=1,                                                       
       lon.class=West}    => {urban.stress=1}     0.1250  1.0000000 1.7777778
[163] {affluence=1,                                                          
       unemployment=1,                                                       
       urban.stress=1}    => {lon.class=West}     0.1250  1.0000000 3.2000000
[164] {unemployment=1,                                                       
       urban.stress=1,                                                       
       lon.class=West}    => {affluence=1}        0.1250  1.0000000 4.0000000
[165] {affluence=1,                                                          
       unemployment=1,                                                       
       lon.class=West}    => {prop.white=1}       0.1250  1.0000000 1.1428571
[166] {unemployment=1,                                                       
       prop.white=1,                                                         
       lon.class=West}    => {affluence=1}        0.1250  1.0000000 4.0000000
[167] {affluence=1,                                                          
       unemployment=1,                                                       
       urban.stress=1}    => {lat.class=Central}  0.1250  1.0000000 2.6666667
[168] {affluence=1,                                                          
       urban.stress=1,                                                       
       lat.class=Central} => {unemployment=1}     0.1250  1.0000000 4.0000000
[169] {unemployment=1,                                                       
       urban.stress=1,                                                       
       lat.class=Central} => {affluence=1}        0.1250  1.0000000 4.0000000
[170] {affluence=1,                                                          
       unemployment=1,                                                       
       lat.class=Central} => {prop.white=1}       0.1875  1.0000000 1.1428571
[171] {affluence=1,                                                          
       unemployment=1,                                                       
       prop.white=1}      => {lat.class=Central}  0.1875  1.0000000 2.6666667
[172] {affluence=1,                                                          
       prop.white=1,                                                         
       lat.class=Central} => {unemployment=1}     0.1875  1.0000000 4.0000000
[173] {affluence=1,                                                          
       unemployment=1,                                                       
       urban.stress=1}    => {prop.white=1}       0.1250  1.0000000 1.1428571
[174] {unemployment=1,                                                       
       urban.stress=1,                                                       
       prop.white=1}      => {affluence=1}        0.1250  1.0000000 4.0000000
[175] {affluence=1,                                                          
       lon.class=West,                                                       
       lat.class=Central} => {urban.stress=1}     0.1250  1.0000000 1.7777778
[176] {affluence=1,                                                          
       urban.stress=1,                                                       
       lat.class=Central} => {lon.class=West}     0.1250  1.0000000 3.2000000
[177] {urban.stress=1,                                                       
       lon.class=West,                                                       
       lat.class=Central} => {affluence=1}        0.1250  1.0000000 4.0000000
[178] {affluence=1,                                                          
       lon.class=West,                                                       
       lat.class=Central} => {prop.white=1}       0.1250  1.0000000 1.1428571
[179] {prop.white=1,                                                         
       lon.class=West,                                                       
       lat.class=Central} => {affluence=1}        0.1250  1.0000000 4.0000000
[180] {affluence=1,                                                          
       urban.stress=1,                                                       
       lon.class=West}    => {prop.white=1}       0.1875  1.0000000 1.1428571
[181] {affluence=1,                                                          
       prop.white=1,                                                         
       lon.class=West}    => {urban.stress=1}     0.1875  1.0000000 1.7777778
[182] {affluence=1,                                                          
       urban.stress=1,                                                       
       prop.white=1}      => {lon.class=West}     0.1875  1.0000000 3.2000000
[183] {affluence=1,                                                          
       urban.stress=1,                                                       
       lat.class=Central} => {prop.white=1}       0.1250  1.0000000 1.1428571
[184] {urban.stress=1,                                                       
       prop.white=1,                                                         
       lat.class=Central} => {affluence=1}        0.1250  1.0000000 4.0000000
[185] {unemployment=1,                                                       
       lon.class=West,                                                       
       lat.class=Central} => {urban.stress=1}     0.1250  1.0000000 1.7777778
[186] {unemployment=1,                                                       
       urban.stress=1,                                                       
       lon.class=West}    => {lat.class=Central}  0.1250  1.0000000 2.6666667
[187] {unemployment=1,                                                       
       urban.stress=1,                                                       
       lat.class=Central} => {lon.class=West}     0.1250  1.0000000 3.2000000
[188] {urban.stress=1,                                                       
       lon.class=West,                                                       
       lat.class=Central} => {unemployment=1}     0.1250  1.0000000 4.0000000
[189] {unemployment=1,                                                       
       lon.class=West,                                                       
       lat.class=Central} => {prop.white=1}       0.1250  1.0000000 1.1428571
[190] {unemployment=1,                                                       
       prop.white=1,                                                         
       lon.class=West}    => {lat.class=Central}  0.1250  1.0000000 2.6666667
[191] {prop.white=1,                                                         
       lon.class=West,                                                       
       lat.class=Central} => {unemployment=1}     0.1250  1.0000000 4.0000000
[192] {unemployment=1,                                                       
       urban.stress=1,                                                       
       lon.class=West}    => {prop.white=1}       0.1250  1.0000000 1.1428571
[193] {unemployment=1,                                                       
       prop.white=1,                                                         
       lon.class=West}    => {urban.stress=1}     0.1250  1.0000000 1.7777778
[194] {unemployment=1,                                                       
       urban.stress=1,                                                       
       prop.white=1}      => {lon.class=West}     0.1250  1.0000000 3.2000000
[195] {unemployment=1,                                                       
       urban.stress=2,                                                       
       lat.class=Central} => {lon.class=Central}  0.1250  1.0000000 2.6666667
[196] {unemployment=1,                                                       
       urban.stress=2,                                                       
       lon.class=Central} => {lat.class=Central}  0.1250  1.0000000 2.6666667
[197] {unemployment=1,                                                       
       lon.class=Central,                                                    
       lat.class=Central} => {urban.stress=2}     0.1250  1.0000000 2.6666667
[198] {urban.stress=2,                                                       
       lon.class=Central,                                                    
       lat.class=Central} => {unemployment=1}     0.1250  1.0000000 4.0000000
[199] {unemployment=1,                                                       
       urban.stress=2,                                                       
       lat.class=Central} => {prop.white=1}       0.1250  1.0000000 1.1428571
[200] {unemployment=1,                                                       
       urban.stress=2,                                                       
       prop.white=1}      => {lat.class=Central}  0.1250  1.0000000 2.6666667
[201] {unemployment=1,                                                       
       urban.stress=2,                                                       
       lon.class=Central} => {prop.white=1}       0.1250  1.0000000 1.1428571
[202] {unemployment=1,                                                       
       urban.stress=2,                                                       
       prop.white=1}      => {lon.class=Central}  0.1250  1.0000000 2.6666667
[203] {unemployment=1,                                                       
       prop.white=1,                                                         
       lon.class=Central} => {urban.stress=2}     0.1250  1.0000000 2.6666667
[204] {urban.stress=2,                                                       
       prop.white=1,                                                         
       lon.class=Central} => {unemployment=1}     0.1250  1.0000000 4.0000000
[205] {unemployment=1,                                                       
       lon.class=Central,                                                    
       lat.class=Central} => {prop.white=1}       0.1250  1.0000000 1.1428571
[206] {unemployment=1,                                                       
       prop.white=1,                                                         
       lon.class=Central} => {lat.class=Central}  0.1250  1.0000000 2.6666667
[207] {prop.white=1,                                                         
       lon.class=Central,                                                    
       lat.class=Central} => {unemployment=1}     0.1250  1.0000000 4.0000000
[208] {unemployment=1,                                                       
       urban.stress=1,                                                       
       lat.class=Central} => {prop.white=1}       0.1250  1.0000000 1.1428571
[209] {unemployment=1,                                                       
       urban.stress=1,                                                       
       prop.white=1}      => {lat.class=Central}  0.1250  1.0000000 2.6666667
[210] {urban.stress=1,                                                       
       prop.white=1,                                                         
       lat.class=Central} => {unemployment=1}     0.1250  1.0000000 4.0000000
[211] {urban.stress=2,                                                       
       lon.class=East,                                                       
       lat.class=South}   => {affluence=3}        0.1250  1.0000000 2.6666667
[212] {affluence=3,                                                          
       urban.stress=2,                                                       
       lat.class=South}   => {lon.class=East}     0.1250  1.0000000 3.2000000
[213] {affluence=2,                                                          
       lon.class=Central,                                                    
       lat.class=South}   => {urban.stress=1}     0.1250  1.0000000 1.7777778
[214] {affluence=2,                                                          
       urban.stress=1,                                                       
       lat.class=South}   => {lon.class=Central}  0.1250  1.0000000 2.6666667
[215] {urban.stress=1,                                                       
       lon.class=Central,                                                    
       lat.class=South}   => {affluence=2}        0.1250  1.0000000 2.6666667
[216] {affluence=2,                                                          
       lon.class=Central,                                                    
       lat.class=South}   => {prop.white=1}       0.1250  1.0000000 1.1428571
[217] {affluence=2,                                                          
       prop.white=1,                                                         
       lat.class=South}   => {lon.class=Central}  0.1250  1.0000000 2.6666667
[218] {prop.white=1,                                                         
       lon.class=Central,                                                    
       lat.class=South}   => {affluence=2}        0.1250  1.0000000 2.6666667
[219] {affluence=2,                                                          
       urban.stress=1,                                                       
       lat.class=South}   => {prop.white=1}       0.1250  1.0000000 1.1428571
[220] {affluence=2,                                                          
       prop.white=1,                                                         
       lat.class=South}   => {urban.stress=1}     0.1250  1.0000000 1.7777778
[221] {urban.stress=1,                                                       
       prop.white=1,                                                         
       lat.class=South}   => {affluence=2}        0.1250  1.0000000 2.6666667
[222] {urban.stress=1,                                                       
       lon.class=Central,                                                    
       lat.class=South}   => {prop.white=1}       0.1250  1.0000000 1.1428571
[223] {prop.white=1,                                                         
       lon.class=Central,                                                    
       lat.class=South}   => {urban.stress=1}     0.1250  1.0000000 1.7777778
[224] {urban.stress=1,                                                       
       prop.white=1,                                                         
       lat.class=South}   => {lon.class=Central}  0.1250  1.0000000 2.6666667
[225] {affluence=3,                                                          
       lon.class=East,                                                       
       lat.class=Central} => {urban.stress=2}     0.1250  1.0000000 2.6666667
[226] {urban.stress=2,                                                       
       lon.class=East,                                                       
       lat.class=Central} => {affluence=3}        0.1250  1.0000000 2.6666667
[227] {affluence=3,                                                          
       unemployment=2,                                                       
       lon.class=East}    => {urban.stress=2}     0.1875  1.0000000 2.6666667
[228] {unemployment=2,                                                       
       urban.stress=2,                                                       
       lon.class=East}    => {affluence=3}        0.1875  1.0000000 2.6666667
[229] {affluence=3,                                                          
       unemployment=2,                                                       
       urban.stress=2}    => {lon.class=East}     0.1875  1.0000000 3.2000000
[230] {affluence=3,                                                          
       prop.white=1,                                                         
       lon.class=East}    => {urban.stress=2}     0.1875  1.0000000 2.6666667
[231] {urban.stress=2,                                                       
       prop.white=1,                                                         
       lon.class=East}    => {affluence=3}        0.1875  1.0000000 2.6666667
[232] {affluence=3,                                                          
       lon.class=East,                                                       
       lat.class=Central} => {unemployment=2}     0.1250  1.0000000 1.7777778
[233] {unemployment=2,                                                       
       lon.class=East,                                                       
       lat.class=Central} => {affluence=3}        0.1250  1.0000000 2.6666667
[234] {affluence=3,                                                          
       unemployment=2,                                                       
       lat.class=Central} => {lon.class=East}     0.1250  1.0000000 3.2000000
[235] {affluence=3,                                                          
       lon.class=East,                                                       
       lat.class=Central} => {prop.white=1}       0.1250  1.0000000 1.1428571
[236] {prop.white=1,                                                         
       lon.class=East,                                                       
       lat.class=Central} => {affluence=3}        0.1250  1.0000000 2.6666667
[237] {affluence=3,                                                          
       unemployment=2,                                                       
       lon.class=East}    => {prop.white=1}       0.1875  1.0000000 1.1428571
[238] {affluence=3,                                                          
       prop.white=1,                                                         
       lon.class=East}    => {unemployment=2}     0.1875  1.0000000 1.7777778
[239] {unemployment=2,                                                       
       prop.white=1,                                                         
       lon.class=East}    => {affluence=3}        0.1875  1.0000000 2.6666667
[240] {affluence=3,                                                          
       unemployment=2,                                                       
       prop.white=1}      => {lon.class=East}     0.1875  1.0000000 3.2000000
[241] {urban.stress=2,                                                       
       lon.class=East,                                                       
       lat.class=Central} => {unemployment=2}     0.1250  1.0000000 1.7777778
[242] {unemployment=2,                                                       
       lon.class=East,                                                       
       lat.class=Central} => {urban.stress=2}     0.1250  1.0000000 2.6666667
[243] {unemployment=2,                                                       
       urban.stress=2,                                                       
       lat.class=Central} => {lon.class=East}     0.1250  1.0000000 3.2000000
[244] {urban.stress=2,                                                       
       lon.class=East,                                                       
       lat.class=Central} => {prop.white=1}       0.1250  1.0000000 1.1428571
[245] {prop.white=1,                                                         
       lon.class=East,                                                       
       lat.class=Central} => {urban.stress=2}     0.1250  1.0000000 2.6666667
[246] {unemployment=2,                                                       
       urban.stress=2,                                                       
       lon.class=East}    => {prop.white=1}       0.1875  1.0000000 1.1428571
[247] {urban.stress=2,                                                       
       prop.white=1,                                                         
       lon.class=East}    => {unemployment=2}     0.1875  1.0000000 1.7777778
[248] {unemployment=2,                                                       
       prop.white=1,                                                         
       lon.class=East}    => {urban.stress=2}     0.1875  1.0000000 2.6666667
[249] {unemployment=2,                                                       
       urban.stress=2,                                                       
       prop.white=1}      => {lon.class=East}     0.1875  1.0000000 3.2000000
[250] {unemployment=2,                                                       
       lon.class=East,                                                       
       lat.class=Central} => {prop.white=1}       0.1250  1.0000000 1.1428571
[251] {prop.white=1,                                                         
       lon.class=East,                                                       
       lat.class=Central} => {unemployment=2}     0.1250  1.0000000 1.7777778
[252] {unemployment=2,                                                       
       prop.white=1,                                                         
       lat.class=Central} => {lon.class=East}     0.1250  1.0000000 3.2000000
[253] {affluence=2,                                                          
       lon.class=West,                                                       
       lat.class=North}   => {urban.stress=1}     0.1250  1.0000000 1.7777778
[254] {affluence=2,                                                          
       urban.stress=1,                                                       
       lon.class=West}    => {lat.class=North}    0.1250  1.0000000 3.2000000
[255] {affluence=2,                                                          
       lon.class=West,                                                       
       lat.class=North}   => {unemployment=2}     0.1250  1.0000000 1.7777778
[256] {affluence=2,                                                          
       unemployment=2,                                                       
       lon.class=West}    => {lat.class=North}    0.1250  1.0000000 3.2000000
[257] {affluence=2,                                                          
       lon.class=West,                                                       
       lat.class=North}   => {prop.white=1}       0.1250  1.0000000 1.1428571
[258] {affluence=2,                                                          
       prop.white=1,                                                         
       lon.class=West}    => {lat.class=North}    0.1250  1.0000000 3.2000000
[259] {urban.stress=1,                                                       
       lon.class=West,                                                       
       lat.class=North}   => {unemployment=2}     0.1875  1.0000000 1.7777778
[260] {unemployment=2,                                                       
       lon.class=West,                                                       
       lat.class=North}   => {urban.stress=1}     0.1875  1.0000000 1.7777778
[261] {unemployment=2,                                                       
       urban.stress=1,                                                       
       lon.class=West}    => {lat.class=North}    0.1875  1.0000000 3.2000000
[262] {urban.stress=1,                                                       
       lon.class=West,                                                       
       lat.class=North}   => {prop.white=1}       0.1875  1.0000000 1.1428571
[263] {prop.white=1,                                                         
       lon.class=West,                                                       
       lat.class=North}   => {urban.stress=1}     0.1875  1.0000000 1.7777778
[264] {unemployment=2,                                                       
       lon.class=West,                                                       
       lat.class=North}   => {prop.white=1}       0.1875  1.0000000 1.1428571
[265] {prop.white=1,                                                         
       lon.class=West,                                                       
       lat.class=North}   => {unemployment=2}     0.1875  1.0000000 1.7777778
[266] {unemployment=2,                                                       
       prop.white=1,                                                         
       lon.class=West}    => {lat.class=North}    0.1875  1.0000000 3.2000000
[267] {affluence=2,                                                          
       urban.stress=1,                                                       
       lon.class=West}    => {unemployment=2}     0.1250  1.0000000 1.7777778
[268] {affluence=2,                                                          
       unemployment=2,                                                       
       lon.class=West}    => {urban.stress=1}     0.1250  1.0000000 1.7777778
[269] {affluence=2,                                                          
       urban.stress=1,                                                       
       lon.class=West}    => {prop.white=1}       0.1250  1.0000000 1.1428571
[270] {affluence=2,                                                          
       prop.white=1,                                                         
       lon.class=West}    => {urban.stress=1}     0.1250  1.0000000 1.7777778
[271] {affluence=2,                                                          
       unemployment=2,                                                       
       lon.class=West}    => {prop.white=1}       0.1250  1.0000000 1.1428571
[272] {affluence=2,                                                          
       prop.white=1,                                                         
       lon.class=West}    => {unemployment=2}     0.1250  1.0000000 1.7777778
[273] {urban.stress=1,                                                       
       lon.class=West,                                                       
       lat.class=Central} => {prop.white=1}       0.1250  1.0000000 1.1428571
[274] {prop.white=1,                                                         
       lon.class=West,                                                       
       lat.class=Central} => {urban.stress=1}     0.1250  1.0000000 1.7777778
[275] {urban.stress=1,                                                       
       prop.white=1,                                                         
       lat.class=Central} => {lon.class=West}     0.1250  1.0000000 3.2000000
[276] {unemployment=2,                                                       
       urban.stress=1,                                                       
       lon.class=West}    => {prop.white=1}       0.1875  1.0000000 1.1428571
[277] {unemployment=2,                                                       
       prop.white=1,                                                         
       lon.class=West}    => {urban.stress=1}     0.1875  1.0000000 1.7777778
[278] {affluence=2,                                                          
       lon.class=Central,                                                    
       lat.class=North}   => {urban.stress=1}     0.1250  1.0000000 1.7777778
[279] {urban.stress=1,                                                       
       lon.class=Central,                                                    
       lat.class=North}   => {affluence=2}        0.1250  1.0000000 2.6666667
[280] {affluence=2,                                                          
       lon.class=Central,                                                    
       lat.class=North}   => {unemployment=2}     0.1250  1.0000000 1.7777778
[281] {unemployment=2,                                                       
       lon.class=Central,                                                    
       lat.class=North}   => {affluence=2}        0.1250  1.0000000 2.6666667
[282] {affluence=2,                                                          
       lon.class=Central,                                                    
       lat.class=North}   => {prop.white=1}       0.1250  1.0000000 1.1428571
[283] {prop.white=1,                                                         
       lon.class=Central,                                                    
       lat.class=North}   => {affluence=2}        0.1250  1.0000000 2.6666667
[284] {affluence=2,                                                          
       urban.stress=1,                                                       
       lat.class=North}   => {unemployment=2}     0.2500  1.0000000 1.7777778
[285] {affluence=2,                                                          
       unemployment=2,                                                       
       lat.class=North}   => {urban.stress=1}     0.2500  1.0000000 1.7777778
[286] {unemployment=2,                                                       
       urban.stress=1,                                                       
       lat.class=North}   => {affluence=2}        0.2500  0.8000000 2.1333333
[287] {affluence=2,                                                          
       unemployment=2,                                                       
       urban.stress=1}    => {lat.class=North}    0.2500  0.8000000 2.5600000
[288] {affluence=2,                                                          
       urban.stress=1,                                                       
       lat.class=North}   => {prop.white=1}       0.2500  1.0000000 1.1428571
[289] {affluence=2,                                                          
       prop.white=1,                                                         
       lat.class=North}   => {urban.stress=1}     0.2500  1.0000000 1.7777778
[290] {urban.stress=1,                                                       
       prop.white=1,                                                         
       lat.class=North}   => {affluence=2}        0.2500  0.8000000 2.1333333
[291] {affluence=2,                                                          
       unemployment=2,                                                       
       lat.class=North}   => {prop.white=1}       0.2500  1.0000000 1.1428571
[292] {affluence=2,                                                          
       prop.white=1,                                                         
       lat.class=North}   => {unemployment=2}     0.2500  1.0000000 1.7777778
[293] {unemployment=2,                                                       
       prop.white=1,                                                         
       lat.class=North}   => {affluence=2}        0.2500  0.8000000 2.1333333
[294] {affluence=2,                                                          
       unemployment=2,                                                       
       prop.white=1}      => {lat.class=North}    0.2500  0.8000000 2.5600000
[295] {urban.stress=1,                                                       
       lon.class=Central,                                                    
       lat.class=North}   => {unemployment=2}     0.1250  1.0000000 1.7777778
[296] {unemployment=2,                                                       
       lon.class=Central,                                                    
       lat.class=North}   => {urban.stress=1}     0.1250  1.0000000 1.7777778
[297] {urban.stress=1,                                                       
       lon.class=Central,                                                    
       lat.class=North}   => {prop.white=1}       0.1250  1.0000000 1.1428571
[298] {prop.white=1,                                                         
       lon.class=Central,                                                    
       lat.class=North}   => {urban.stress=1}     0.1250  1.0000000 1.7777778
[299] {unemployment=2,                                                       
       lon.class=Central,                                                    
       lat.class=North}   => {prop.white=1}       0.1250  1.0000000 1.1428571
[300] {prop.white=1,                                                         
       lon.class=Central,                                                    
       lat.class=North}   => {unemployment=2}     0.1250  1.0000000 1.7777778
[301] {unemployment=2,                                                       
       urban.stress=1,                                                       
       lat.class=North}   => {prop.white=1}       0.3125  1.0000000 1.1428571
[302] {urban.stress=1,                                                       
       prop.white=1,                                                         
       lat.class=North}   => {unemployment=2}     0.3125  1.0000000 1.7777778
[303] {unemployment=2,                                                       
       prop.white=1,                                                         
       lat.class=North}   => {urban.stress=1}     0.3125  1.0000000 1.7777778
[304] {unemployment=2,                                                       
       urban.stress=1,                                                       
       prop.white=1}      => {lat.class=North}    0.3125  0.8333333 2.6666667
[305] {affluence=2,                                                          
       unemployment=2,                                                       
       lon.class=Central} => {urban.stress=1}     0.1875  1.0000000 1.7777778
[306] {unemployment=2,                                                       
       urban.stress=1,                                                       
       lon.class=Central} => {affluence=2}        0.1875  1.0000000 2.6666667
[307] {affluence=2,                                                          
       urban.stress=1,                                                       
       lon.class=Central} => {prop.white=1}       0.2500  1.0000000 1.1428571
[308] {affluence=2,                                                          
       prop.white=1,                                                         
       lon.class=Central} => {urban.stress=1}     0.2500  1.0000000 1.7777778
[309] {urban.stress=1,                                                       
       prop.white=1,                                                         
       lon.class=Central} => {affluence=2}        0.2500  1.0000000 2.6666667
[310] {affluence=2,                                                          
       unemployment=2,                                                       
       lon.class=Central} => {prop.white=1}       0.1875  1.0000000 1.1428571
[311] {unemployment=2,                                                       
       prop.white=1,                                                         
       lon.class=Central} => {affluence=2}        0.1875  1.0000000 2.6666667
[312] {affluence=2,                                                          
       unemployment=2,                                                       
       urban.stress=1}    => {prop.white=1}       0.3125  1.0000000 1.1428571
[313] {affluence=2,                                                          
       urban.stress=1,                                                       
       prop.white=1}      => {unemployment=2}     0.3125  0.8333333 1.4814815
[314] {affluence=2,                                                          
       unemployment=2,                                                       
       prop.white=1}      => {urban.stress=1}     0.3125  1.0000000 1.7777778
[315] {unemployment=2,                                                       
       urban.stress=1,                                                       
       prop.white=1}      => {affluence=2}        0.3125  0.8333333 2.2222222
[316] {affluence=3,                                                          
       unemployment=2,                                                       
       lat.class=Central} => {urban.stress=2}     0.1250  1.0000000 2.6666667
[317] {unemployment=2,                                                       
       urban.stress=2,                                                       
       lat.class=Central} => {affluence=3}        0.1250  1.0000000 2.6666667
[318] {affluence=3,                                                          
       urban.stress=2,                                                       
       lat.class=Central} => {prop.white=1}       0.1875  1.0000000 1.1428571
[319] {affluence=3,                                                          
       prop.white=1,                                                         
       lat.class=Central} => {urban.stress=2}     0.1875  1.0000000 2.6666667
[320] {affluence=3,                                                          
       unemployment=2,                                                       
       urban.stress=2}    => {prop.white=1}       0.1875  1.0000000 1.1428571
[321] {affluence=3,                                                          
       unemployment=2,                                                       
       prop.white=1}      => {urban.stress=2}     0.1875  1.0000000 2.6666667
[322] {unemployment=2,                                                       
       urban.stress=2,                                                       
       prop.white=1}      => {affluence=3}        0.1875  1.0000000 2.6666667
[323] {affluence=3,                                                          
       unemployment=2,                                                       
       lat.class=Central} => {prop.white=1}       0.1250  1.0000000 1.1428571
[324] {unemployment=2,                                                       
       prop.white=1,                                                         
       lat.class=Central} => {affluence=3}        0.1250  1.0000000 2.6666667
[325] {urban.stress=2,                                                       
       lon.class=Central,                                                    
       lat.class=Central} => {prop.white=1}       0.1250  1.0000000 1.1428571
[326] {urban.stress=2,                                                       
       prop.white=1,                                                         
       lon.class=Central} => {lat.class=Central}  0.1250  1.0000000 2.6666667
[327] {prop.white=1,                                                         
       lon.class=Central,                                                    
       lat.class=Central} => {urban.stress=2}     0.1250  1.0000000 2.6666667
[328] {unemployment=2,                                                       
       urban.stress=2,                                                       
       lat.class=Central} => {prop.white=1}       0.1250  1.0000000 1.1428571
[329] {unemployment=2,                                                       
       prop.white=1,                                                         
       lat.class=Central} => {urban.stress=2}     0.1250  1.0000000 2.6666667
[330] {unemployment=2,                                                       
       urban.stress=1,                                                       
       lon.class=Central} => {prop.white=1}       0.1875  1.0000000 1.1428571
[331] {unemployment=2,                                                       
       prop.white=1,                                                         
       lon.class=Central} => {urban.stress=1}     0.1875  1.0000000 1.7777778
[332] {affluence=1,                                                          
       unemployment=1,                                                       
       lon.class=West,                                                       
       lat.class=Central} => {urban.stress=1}     0.1250  1.0000000 1.7777778
[333] {affluence=1,                                                          
       unemployment=1,                                                       
       urban.stress=1,                                                       
       lon.class=West}    => {lat.class=Central}  0.1250  1.0000000 2.6666667
[334] {affluence=1,                                                          
       unemployment=1,                                                       
       urban.stress=1,                                                       
       lat.class=Central} => {lon.class=West}     0.1250  1.0000000 3.2000000
[335] {affluence=1,                                                          
       urban.stress=1,                                                       
       lon.class=West,                                                       
       lat.class=Central} => {unemployment=1}     0.1250  1.0000000 4.0000000
[336] {unemployment=1,                                                       
       urban.stress=1,                                                       
       lon.class=West,                                                       
       lat.class=Central} => {affluence=1}        0.1250  1.0000000 4.0000000
[337] {affluence=1,                                                          
       unemployment=1,                                                       
       lon.class=West,                                                       
       lat.class=Central} => {prop.white=1}       0.1250  1.0000000 1.1428571
[338] {affluence=1,                                                          
       unemployment=1,                                                       
       prop.white=1,                                                         
       lon.class=West}    => {lat.class=Central}  0.1250  1.0000000 2.6666667
[339] {affluence=1,                                                          
       prop.white=1,                                                         
       lon.class=West,                                                       
       lat.class=Central} => {unemployment=1}     0.1250  1.0000000 4.0000000
[340] {unemployment=1,                                                       
       prop.white=1,                                                         
       lon.class=West,                                                       
       lat.class=Central} => {affluence=1}        0.1250  1.0000000 4.0000000
[341] {affluence=1,                                                          
       unemployment=1,                                                       
       urban.stress=1,                                                       
       lon.class=West}    => {prop.white=1}       0.1250  1.0000000 1.1428571
[342] {affluence=1,                                                          
       unemployment=1,                                                       
       prop.white=1,                                                         
       lon.class=West}    => {urban.stress=1}     0.1250  1.0000000 1.7777778
[343] {affluence=1,                                                          
       unemployment=1,                                                       
       urban.stress=1,                                                       
       prop.white=1}      => {lon.class=West}     0.1250  1.0000000 3.2000000
[344] {unemployment=1,                                                       
       urban.stress=1,                                                       
       prop.white=1,                                                         
       lon.class=West}    => {affluence=1}        0.1250  1.0000000 4.0000000
[345] {affluence=1,                                                          
       unemployment=1,                                                       
       urban.stress=1,                                                       
       lat.class=Central} => {prop.white=1}       0.1250  1.0000000 1.1428571
[346] {affluence=1,                                                          
       unemployment=1,                                                       
       urban.stress=1,                                                       
       prop.white=1}      => {lat.class=Central}  0.1250  1.0000000 2.6666667
[347] {affluence=1,                                                          
       urban.stress=1,                                                       
       prop.white=1,                                                         
       lat.class=Central} => {unemployment=1}     0.1250  1.0000000 4.0000000
[348] {unemployment=1,                                                       
       urban.stress=1,                                                       
       prop.white=1,                                                         
       lat.class=Central} => {affluence=1}        0.1250  1.0000000 4.0000000
[349] {affluence=1,                                                          
       urban.stress=1,                                                       
       lon.class=West,                                                       
       lat.class=Central} => {prop.white=1}       0.1250  1.0000000 1.1428571
[350] {affluence=1,                                                          
       prop.white=1,                                                         
       lon.class=West,                                                       
       lat.class=Central} => {urban.stress=1}     0.1250  1.0000000 1.7777778
[351] {affluence=1,                                                          
       urban.stress=1,                                                       
       prop.white=1,                                                         
       lat.class=Central} => {lon.class=West}     0.1250  1.0000000 3.2000000
[352] {urban.stress=1,                                                       
       prop.white=1,                                                         
       lon.class=West,                                                       
       lat.class=Central} => {affluence=1}        0.1250  1.0000000 4.0000000
[353] {unemployment=1,                                                       
       urban.stress=1,                                                       
       lon.class=West,                                                       
       lat.class=Central} => {prop.white=1}       0.1250  1.0000000 1.1428571
[354] {unemployment=1,                                                       
       prop.white=1,                                                         
       lon.class=West,                                                       
       lat.class=Central} => {urban.stress=1}     0.1250  1.0000000 1.7777778
[355] {unemployment=1,                                                       
       urban.stress=1,                                                       
       prop.white=1,                                                         
       lon.class=West}    => {lat.class=Central}  0.1250  1.0000000 2.6666667
[356] {unemployment=1,                                                       
       urban.stress=1,                                                       
       prop.white=1,                                                         
       lat.class=Central} => {lon.class=West}     0.1250  1.0000000 3.2000000
[357] {urban.stress=1,                                                       
       prop.white=1,                                                         
       lon.class=West,                                                       
       lat.class=Central} => {unemployment=1}     0.1250  1.0000000 4.0000000
[358] {unemployment=1,                                                       
       urban.stress=2,                                                       
       lon.class=Central,                                                    
       lat.class=Central} => {prop.white=1}       0.1250  1.0000000 1.1428571
[359] {unemployment=1,                                                       
       urban.stress=2,                                                       
       prop.white=1,                                                         
       lat.class=Central} => {lon.class=Central}  0.1250  1.0000000 2.6666667
[360] {unemployment=1,                                                       
       urban.stress=2,                                                       
       prop.white=1,                                                         
       lon.class=Central} => {lat.class=Central}  0.1250  1.0000000 2.6666667
[361] {unemployment=1,                                                       
       prop.white=1,                                                         
       lon.class=Central,                                                    
       lat.class=Central} => {urban.stress=2}     0.1250  1.0000000 2.6666667
[362] {urban.stress=2,                                                       
       prop.white=1,                                                         
       lon.class=Central,                                                    
       lat.class=Central} => {unemployment=1}     0.1250  1.0000000 4.0000000
[363] {affluence=2,                                                          
       urban.stress=1,                                                       
       lon.class=Central,                                                    
       lat.class=South}   => {prop.white=1}       0.1250  1.0000000 1.1428571
[364] {affluence=2,                                                          
       prop.white=1,                                                         
       lon.class=Central,                                                    
       lat.class=South}   => {urban.stress=1}     0.1250  1.0000000 1.7777778
[365] {affluence=2,                                                          
       urban.stress=1,                                                       
       prop.white=1,                                                         
       lat.class=South}   => {lon.class=Central}  0.1250  1.0000000 2.6666667
[366] {urban.stress=1,                                                       
       prop.white=1,                                                         
       lon.class=Central,                                                    
       lat.class=South}   => {affluence=2}        0.1250  1.0000000 2.6666667
[367] {affluence=3,                                                          
       urban.stress=2,                                                       
       lon.class=East,                                                       
       lat.class=Central} => {unemployment=2}     0.1250  1.0000000 1.7777778
[368] {affluence=3,                                                          
       unemployment=2,                                                       
       lon.class=East,                                                       
       lat.class=Central} => {urban.stress=2}     0.1250  1.0000000 2.6666667
[369] {unemployment=2,                                                       
       urban.stress=2,                                                       
       lon.class=East,                                                       
       lat.class=Central} => {affluence=3}        0.1250  1.0000000 2.6666667
[370] {affluence=3,                                                          
       unemployment=2,                                                       
       urban.stress=2,                                                       
       lat.class=Central} => {lon.class=East}     0.1250  1.0000000 3.2000000
[371] {affluence=3,                                                          
       urban.stress=2,                                                       
       lon.class=East,                                                       
       lat.class=Central} => {prop.white=1}       0.1250  1.0000000 1.1428571
[372] {affluence=3,                                                          
       prop.white=1,                                                         
       lon.class=East,                                                       
       lat.class=Central} => {urban.stress=2}     0.1250  1.0000000 2.6666667
[373] {urban.stress=2,                                                       
       prop.white=1,                                                         
       lon.class=East,                                                       
       lat.class=Central} => {affluence=3}        0.1250  1.0000000 2.6666667
[374] {affluence=3,                                                          
       unemployment=2,                                                       
       urban.stress=2,                                                       
       lon.class=East}    => {prop.white=1}       0.1875  1.0000000 1.1428571
[375] {affluence=3,                                                          
       urban.stress=2,                                                       
       prop.white=1,                                                         
       lon.class=East}    => {unemployment=2}     0.1875  1.0000000 1.7777778
[376] {affluence=3,                                                          
       unemployment=2,                                                       
       prop.white=1,                                                         
       lon.class=East}    => {urban.stress=2}     0.1875  1.0000000 2.6666667
[377] {unemployment=2,                                                       
       urban.stress=2,                                                       
       prop.white=1,                                                         
       lon.class=East}    => {affluence=3}        0.1875  1.0000000 2.6666667
[378] {affluence=3,                                                          
       unemployment=2,                                                       
       urban.stress=2,                                                       
       prop.white=1}      => {lon.class=East}     0.1875  1.0000000 3.2000000
[379] {affluence=3,                                                          
       unemployment=2,                                                       
       lon.class=East,                                                       
       lat.class=Central} => {prop.white=1}       0.1250  1.0000000 1.1428571
[380] {affluence=3,                                                          
       prop.white=1,                                                         
       lon.class=East,                                                       
       lat.class=Central} => {unemployment=2}     0.1250  1.0000000 1.7777778
[381] {unemployment=2,                                                       
       prop.white=1,                                                         
       lon.class=East,                                                       
       lat.class=Central} => {affluence=3}        0.1250  1.0000000 2.6666667
[382] {affluence=3,                                                          
       unemployment=2,                                                       
       prop.white=1,                                                         
       lat.class=Central} => {lon.class=East}     0.1250  1.0000000 3.2000000
[383] {unemployment=2,                                                       
       urban.stress=2,                                                       
       lon.class=East,                                                       
       lat.class=Central} => {prop.white=1}       0.1250  1.0000000 1.1428571
[384] {urban.stress=2,                                                       
       prop.white=1,                                                         
       lon.class=East,                                                       
       lat.class=Central} => {unemployment=2}     0.1250  1.0000000 1.7777778
[385] {unemployment=2,                                                       
       prop.white=1,                                                         
       lon.class=East,                                                       
       lat.class=Central} => {urban.stress=2}     0.1250  1.0000000 2.6666667
[386] {unemployment=2,                                                       
       urban.stress=2,                                                       
       prop.white=1,                                                         
       lat.class=Central} => {lon.class=East}     0.1250  1.0000000 3.2000000
[387] {affluence=2,                                                          
       urban.stress=1,                                                       
       lon.class=West,                                                       
       lat.class=North}   => {unemployment=2}     0.1250  1.0000000 1.7777778
[388] {affluence=2,                                                          
       unemployment=2,                                                       
       lon.class=West,                                                       
       lat.class=North}   => {urban.stress=1}     0.1250  1.0000000 1.7777778
[389] {affluence=2,                                                          
       unemployment=2,                                                       
       urban.stress=1,                                                       
       lon.class=West}    => {lat.class=North}    0.1250  1.0000000 3.2000000
[390] {affluence=2,                                                          
       urban.stress=1,                                                       
       lon.class=West,                                                       
       lat.class=North}   => {prop.white=1}       0.1250  1.0000000 1.1428571
[391] {affluence=2,                                                          
       prop.white=1,                                                         
       lon.class=West,                                                       
       lat.class=North}   => {urban.stress=1}     0.1250  1.0000000 1.7777778
[392] {affluence=2,                                                          
       urban.stress=1,                                                       
       prop.white=1,                                                         
       lon.class=West}    => {lat.class=North}    0.1250  1.0000000 3.2000000
[393] {affluence=2,                                                          
       unemployment=2,                                                       
       lon.class=West,                                                       
       lat.class=North}   => {prop.white=1}       0.1250  1.0000000 1.1428571
[394] {affluence=2,                                                          
       prop.white=1,                                                         
       lon.class=West,                                                       
       lat.class=North}   => {unemployment=2}     0.1250  1.0000000 1.7777778
[395] {affluence=2,                                                          
       unemployment=2,                                                       
       prop.white=1,                                                         
       lon.class=West}    => {lat.class=North}    0.1250  1.0000000 3.2000000
[396] {unemployment=2,                                                       
       urban.stress=1,                                                       
       lon.class=West,                                                       
       lat.class=North}   => {prop.white=1}       0.1875  1.0000000 1.1428571
[397] {urban.stress=1,                                                       
       prop.white=1,                                                         
       lon.class=West,                                                       
       lat.class=North}   => {unemployment=2}     0.1875  1.0000000 1.7777778
[398] {unemployment=2,                                                       
       prop.white=1,                                                         
       lon.class=West,                                                       
       lat.class=North}   => {urban.stress=1}     0.1875  1.0000000 1.7777778
[399] {unemployment=2,                                                       
       urban.stress=1,                                                       
       prop.white=1,                                                         
       lon.class=West}    => {lat.class=North}    0.1875  1.0000000 3.2000000
[400] {affluence=2,                                                          
       unemployment=2,                                                       
       urban.stress=1,                                                       
       lon.class=West}    => {prop.white=1}       0.1250  1.0000000 1.1428571
[401] {affluence=2,                                                          
       urban.stress=1,                                                       
       prop.white=1,                                                         
       lon.class=West}    => {unemployment=2}     0.1250  1.0000000 1.7777778
[402] {affluence=2,                                                          
       unemployment=2,                                                       
       prop.white=1,                                                         
       lon.class=West}    => {urban.stress=1}     0.1250  1.0000000 1.7777778
[403] {affluence=2,                                                          
       urban.stress=1,                                                       
       lon.class=Central,                                                    
       lat.class=North}   => {unemployment=2}     0.1250  1.0000000 1.7777778
[404] {affluence=2,                                                          
       unemployment=2,                                                       
       lon.class=Central,                                                    
       lat.class=North}   => {urban.stress=1}     0.1250  1.0000000 1.7777778
[405] {unemployment=2,                                                       
       urban.stress=1,                                                       
       lon.class=Central,                                                    
       lat.class=North}   => {affluence=2}        0.1250  1.0000000 2.6666667
[406] {affluence=2,                                                          
       urban.stress=1,                                                       
       lon.class=Central,                                                    
       lat.class=North}   => {prop.white=1}       0.1250  1.0000000 1.1428571
[407] {affluence=2,                                                          
       prop.white=1,                                                         
       lon.class=Central,                                                    
       lat.class=North}   => {urban.stress=1}     0.1250  1.0000000 1.7777778
[408] {urban.stress=1,                                                       
       prop.white=1,                                                         
       lon.class=Central,                                                    
       lat.class=North}   => {affluence=2}        0.1250  1.0000000 2.6666667
[409] {affluence=2,                                                          
       unemployment=2,                                                       
       lon.class=Central,                                                    
       lat.class=North}   => {prop.white=1}       0.1250  1.0000000 1.1428571
[410] {affluence=2,                                                          
       prop.white=1,                                                         
       lon.class=Central,                                                    
       lat.class=North}   => {unemployment=2}     0.1250  1.0000000 1.7777778
[411] {unemployment=2,                                                       
       prop.white=1,                                                         
       lon.class=Central,                                                    
       lat.class=North}   => {affluence=2}        0.1250  1.0000000 2.6666667
[412] {affluence=2,                                                          
       unemployment=2,                                                       
       urban.stress=1,                                                       
       lat.class=North}   => {prop.white=1}       0.2500  1.0000000 1.1428571
[413] {affluence=2,                                                          
       urban.stress=1,                                                       
       prop.white=1,                                                         
       lat.class=North}   => {unemployment=2}     0.2500  1.0000000 1.7777778
[414] {affluence=2,                                                          
       unemployment=2,                                                       
       prop.white=1,                                                         
       lat.class=North}   => {urban.stress=1}     0.2500  1.0000000 1.7777778
[415] {unemployment=2,                                                       
       urban.stress=1,                                                       
       prop.white=1,                                                         
       lat.class=North}   => {affluence=2}        0.2500  0.8000000 2.1333333
[416] {affluence=2,                                                          
       unemployment=2,                                                       
       urban.stress=1,                                                       
       prop.white=1}      => {lat.class=North}    0.2500  0.8000000 2.5600000
[417] {unemployment=2,                                                       
       urban.stress=1,                                                       
       lon.class=Central,                                                    
       lat.class=North}   => {prop.white=1}       0.1250  1.0000000 1.1428571
[418] {urban.stress=1,                                                       
       prop.white=1,                                                         
       lon.class=Central,                                                    
       lat.class=North}   => {unemployment=2}     0.1250  1.0000000 1.7777778
[419] {unemployment=2,                                                       
       prop.white=1,                                                         
       lon.class=Central,                                                    
       lat.class=North}   => {urban.stress=1}     0.1250  1.0000000 1.7777778
[420] {affluence=2,                                                          
       unemployment=2,                                                       
       urban.stress=1,                                                       
       lon.class=Central} => {prop.white=1}       0.1875  1.0000000 1.1428571
[421] {affluence=2,                                                          
       unemployment=2,                                                       
       prop.white=1,                                                         
       lon.class=Central} => {urban.stress=1}     0.1875  1.0000000 1.7777778
[422] {unemployment=2,                                                       
       urban.stress=1,                                                       
       prop.white=1,                                                         
       lon.class=Central} => {affluence=2}        0.1875  1.0000000 2.6666667
[423] {affluence=3,                                                          
       unemployment=2,                                                       
       urban.stress=2,                                                       
       lat.class=Central} => {prop.white=1}       0.1250  1.0000000 1.1428571
[424] {affluence=3,                                                          
       unemployment=2,                                                       
       prop.white=1,                                                         
       lat.class=Central} => {urban.stress=2}     0.1250  1.0000000 2.6666667
[425] {unemployment=2,                                                       
       urban.stress=2,                                                       
       prop.white=1,                                                         
       lat.class=Central} => {affluence=3}        0.1250  1.0000000 2.6666667
[426] {affluence=1,                                                          
       unemployment=1,                                                       
       urban.stress=1,                                                       
       lon.class=West,                                                       
       lat.class=Central} => {prop.white=1}       0.1250  1.0000000 1.1428571
[427] {affluence=1,                                                          
       unemployment=1,                                                       
       prop.white=1,                                                         
       lon.class=West,                                                       
       lat.class=Central} => {urban.stress=1}     0.1250  1.0000000 1.7777778
[428] {affluence=1,                                                          
       unemployment=1,                                                       
       urban.stress=1,                                                       
       prop.white=1,                                                         
       lon.class=West}    => {lat.class=Central}  0.1250  1.0000000 2.6666667
[429] {affluence=1,                                                          
       unemployment=1,                                                       
       urban.stress=1,                                                       
       prop.white=1,                                                         
       lat.class=Central} => {lon.class=West}     0.1250  1.0000000 3.2000000
[430] {affluence=1,                                                          
       urban.stress=1,                                                       
       prop.white=1,                                                         
       lon.class=West,                                                       
       lat.class=Central} => {unemployment=1}     0.1250  1.0000000 4.0000000
[431] {unemployment=1,                                                       
       urban.stress=1,                                                       
       prop.white=1,                                                         
       lon.class=West,                                                       
       lat.class=Central} => {affluence=1}        0.1250  1.0000000 4.0000000
[432] {affluence=3,                                                          
       unemployment=2,                                                       
       urban.stress=2,                                                       
       lon.class=East,                                                       
       lat.class=Central} => {prop.white=1}       0.1250  1.0000000 1.1428571
[433] {affluence=3,                                                          
       urban.stress=2,                                                       
       prop.white=1,                                                         
       lon.class=East,                                                       
       lat.class=Central} => {unemployment=2}     0.1250  1.0000000 1.7777778
[434] {affluence=3,                                                          
       unemployment=2,                                                       
       prop.white=1,                                                         
       lon.class=East,                                                       
       lat.class=Central} => {urban.stress=2}     0.1250  1.0000000 2.6666667
[435] {unemployment=2,                                                       
       urban.stress=2,                                                       
       prop.white=1,                                                         
       lon.class=East,                                                       
       lat.class=Central} => {affluence=3}        0.1250  1.0000000 2.6666667
[436] {affluence=3,                                                          
       unemployment=2,                                                       
       urban.stress=2,                                                       
       prop.white=1,                                                         
       lat.class=Central} => {lon.class=East}     0.1250  1.0000000 3.2000000
[437] {affluence=2,                                                          
       unemployment=2,                                                       
       urban.stress=1,                                                       
       lon.class=West,                                                       
       lat.class=North}   => {prop.white=1}       0.1250  1.0000000 1.1428571
[438] {affluence=2,                                                          
       urban.stress=1,                                                       
       prop.white=1,                                                         
       lon.class=West,                                                       
       lat.class=North}   => {unemployment=2}     0.1250  1.0000000 1.7777778
[439] {affluence=2,                                                          
       unemployment=2,                                                       
       prop.white=1,                                                         
       lon.class=West,                                                       
       lat.class=North}   => {urban.stress=1}     0.1250  1.0000000 1.7777778
[440] {affluence=2,                                                          
       unemployment=2,                                                       
       urban.stress=1,                                                       
       prop.white=1,                                                         
       lon.class=West}    => {lat.class=North}    0.1250  1.0000000 3.2000000
[441] {affluence=2,                                                          
       unemployment=2,                                                       
       urban.stress=1,                                                       
       lon.class=Central,                                                    
       lat.class=North}   => {prop.white=1}       0.1250  1.0000000 1.1428571
[442] {affluence=2,                                                          
       urban.stress=1,                                                       
       prop.white=1,                                                         
       lon.class=Central,                                                    
       lat.class=North}   => {unemployment=2}     0.1250  1.0000000 1.7777778
[443] {affluence=2,                                                          
       unemployment=2,                                                       
       prop.white=1,                                                         
       lon.class=Central,                                                    
       lat.class=North}   => {urban.stress=1}     0.1250  1.0000000 1.7777778
[444] {unemployment=2,                                                       
       urban.stress=1,                                                       
       prop.white=1,                                                         
       lon.class=Central,                                                    
       lat.class=North}   => {affluence=2}        0.1250  1.0000000 2.6666667

Now, the fun part comes with setting our own parameters to create the list of item-sets! The new object rules2.LA now consists of item-sets that have a minimum support of $0.5$, and minimum confidence of $0.5$.

In [4]:
rules2.LA <- apriori(life.in.LA[,3:8],parameter = list(supp=0.50, conf=0.5),control = list(verbose=F))
rules2.LA.sorted <- sort(rules2.LA, by=c("lift"), decreasing=TRUE) # sort the list by lift (in descending order)
inspect(rules2.LA.sorted) # print out the results
    lhs                 rhs              support confidence lift    
[1] {prop.white=1}   => {unemployment=2} 0.5625  0.6428571  1.142857
[2] {prop.white=1}   => {urban.stress=1} 0.5625  0.6428571  1.142857
[3] {unemployment=2} => {prop.white=1}   0.5625  1.0000000  1.142857
[4] {urban.stress=1} => {prop.white=1}   0.5625  1.0000000  1.142857
[5] {}               => {unemployment=2} 0.5625  0.5625000  1.000000
[6] {}               => {urban.stress=1} 0.5625  0.5625000  1.000000
[7] {}               => {prop.white=1}   0.8750  0.8750000  1.000000

We have a list of 7 rules in above, but are they all independent rules?<br><br> The answer is $\textbf{NO!}$ For example, we have rules {prop.white=1} => {unemployment=2}, and {unemployment=2} => {prop.white=1}, which are simply reciprocals of each other. Hence the rule {unemployment=2} => {prop.white=1} is redundant.<br><br>

Which of the 2 rules should we remove? {prop.white=1} => {unemployment=2}, or {unemployment=2} => {prop.white=1}? <br>

This is not an easy question to answer. To make a point, consider two situations

  • Example 1: We asked people about their favourite sport and a team/player. We found that $100\%$ of people who said that the Ottawa Senators were their favourite team gave hockey as their favourite sport. We also found that $40\%$ of hockey lovers said they cheer for Sens.

  • Example 2: Last year, $40\%$ of successful candidates for a company were graduate students, and $100\%$ of graduate students who applied to this company got a job offer.

In these scenarios, which statements are more interesting?<br><br> In what follows, we attempt to remove all redundant rules. As a result, we remove $2$ rules.

In [7]:
subset.matrix <- as.matrix(is.subset(rules2.LA.sorted, rules2.LA.sorted))
subset.matrix[lower.tri(subset.matrix, diag=T)] <- NA
subset.matrix

class(subset.matrix)

(redundant.LA <- colSums(subset.matrix, na.rm=T) >= 1)
which(redundant.LA)

# remove redundant rules
rules2.LA.pruned <- rules2.LA.sorted[!redundant.LA]
inspect(rules2.LA.pruned)
{unemployment=2,prop.white=1}{urban.stress=1,prop.white=1}{unemployment=2,prop.white=1}{urban.stress=1,prop.white=1}{unemployment=2}{urban.stress=1}{prop.white=1}
{unemployment=2,prop.white=1}NA FALSE TRUEFALSEFALSEFALSEFALSE
{urban.stress=1,prop.white=1}NA NAFALSE TRUEFALSEFALSEFALSE
{unemployment=2,prop.white=1}NA NA NAFALSEFALSEFALSEFALSE
{urban.stress=1,prop.white=1}NA NA NA NAFALSEFALSEFALSE
{unemployment=2}NA NA NA NA NAFALSEFALSE
{urban.stress=1}NA NA NA NA NA NAFALSE
{prop.white=1}NA NA NA NA NA NA NA
'matrix'
{unemployment=2,prop.white=1}
FALSE
{urban.stress=1,prop.white=1}
FALSE
{unemployment=2,prop.white=1}
TRUE
{urban.stress=1,prop.white=1}
TRUE
{unemployment=2}
FALSE
{urban.stress=1}
FALSE
{prop.white=1}
FALSE
{unemployment=2,prop.white=1}
3
{urban.stress=1,prop.white=1}
4
    lhs               rhs              support confidence lift    
[1] {prop.white=1} => {unemployment=2} 0.5625  0.6428571  1.142857
[2] {prop.white=1} => {urban.stress=1} 0.5625  0.6428571  1.142857
[3] {}             => {unemployment=2} 0.5625  0.5625000  1.000000
[4] {}             => {urban.stress=1} 0.5625  0.5625000  1.000000
[5] {}             => {prop.white=1}   0.8750  0.8750000  1.000000

Back to top

3. VISUALIZING ASSOCIATION RULES <a name=visual></a>

So far, we sought interesting associations between attributes, and they were presented in tabular format. Now, let's look at the graphical representation of the association rule (by using package arulesViz). Will we able to extract information?<br>

Unfortunately, the graphical representations do not bring much insight with the parameters given above. The first plot is very, very messy as we have $444$ item-sets to graph. The second graph has much clearner looking; empty-sets direct to $3$ single item-sets (urban.stress=1, unemployment=2, and prop.white=1). We also see loops among urban.stress, unemployment, and prop.white. These loops correspond to what we considered to be redundant. The third plot is even simpler; the loops are removed from the plot.

In [8]:
library(arulesViz)

plot(rules.LA, method="graph", control=list(type="items")) # This one is super messy
plot(rules2.LA, method="graph", control=list(type="items")) # This one is simple
plot(rules2.LA.pruned, method="graph", control=list(type="items")) # This is even simpler

Back to top

4. EXERCISES<a name=exer></a>

  • repeat this process for the titanic dataset, which is defined below.
In [22]:
# load and explore data
class=c(rep("3rd",52),rep("1st",118),rep("2nd",154),rep("3rd",387),rep("Crew",670),rep("1st",4),rep("2nd",13.01),rep("3rd",89),rep("Crew",3),rep("1st",5),rep("2nd",11),rep("3rd",13),rep("1st",1),rep("2nd",13),rep("3rd",14),rep("1st",57),rep("2nd",14),rep("3rd",75),rep("Crew",192),rep("1st",140),rep("2nd",80),rep("3rd",76),rep("Crew",20))
sex=c(rep("Male",35),rep("Female",17),rep("Male",1329),rep("Female",109),rep("Male",29),rep("Female",28),rep("Male",338),rep("Female",316))
age=c(rep("Child",52),rep("Adult",1438),rep("Child",57),rep("Adult",654))
survived=c(rep("No",1490),rep("Yes",711))

titanic=data.frame(class,sex,age,survived)

str(titanic)
summary(titanic)
table(titanic$age,titanic$survived)
table(titanic$class,titanic$survived)
'data.frame':	2201 obs. of  4 variables:
 $ class   : Factor w/ 4 levels "1st","2nd","3rd",..: 3 3 3 3 3 3 3 3 3 3 ...
 $ sex     : Factor w/ 2 levels "Female","Male": 2 2 2 2 2 2 2 2 2 2 ...
 $ age     : Factor w/ 2 levels "Adult","Child": 2 2 2 2 2 2 2 2 2 2 ...
 $ survived: Factor w/ 2 levels "No","Yes": 1 1 1 1 1 1 1 1 1 1 ...
  class         sex          age       survived  
 1st :325   Female: 470   Adult:2092   No :1490  
 2nd :285   Male  :1731   Child: 109   Yes: 711  
 3rd :706                                        
 Crew:885                                        
       
          No  Yes
  Adult 1438  654
  Child   52   57
      
        No Yes
  1st  122 203
  2nd  167 118
  3rd  528 178
  Crew 673 212

  • Look for rules where the consequent consists of either "Survived" levels (i.e., we're trying to figure out what lead to either survival or lack of survival). This can be arranged by adding the appearance parameters to the apriori command, as below:

rules2 <- apriori(titanic,parameter = list(minlen=2, supp=0.005, conf=0.8),appearance = list(rhs=c("survived=No", "survived=Yes"),default="lhs"),control = list(verbose=F))

  • Set the parameters to reduce the number of rules: rules of size at least 2, with support at least greater than 0.005 and confidence greater than 0.8.