Contents

- 1 Lift Analysis
- 2 Chi Squared Analysis
- 2.0.0.1 Q3: Please calculate the following chi squared values for the table correlating burger and chips below (Expected values in brackets).
- 2.0.0.2 Q4: Please calculate the following chi squared values for the table correlating burger and sausages be-low (Expected values in brackets).
- 2.0.0.3 Q5: Under what conditions would Lift and Chi Squared analysis prove to be a poor algorithm to evaluate correlation/dependency between two events?

## Lift Analysis

##### Q1: Please calculate the following lift values for the table correlating burger and chips below:

- Lift (Burger, Chips)
- Lift (Burgers, ^Chips)
- Lift (^Burgers, Chips)
- Lift (^Burgers, ^Chips)

Please also indicate if each of your answers would suggest independent, positive correlation, or negative correlation?

**Lift (B, C) = c(B->C)/s(C) = s (B u C)/(s(B) x s(C))**

Lift (Burger, Chips)

Lift (B, C) = (600/1400)/ ((800/1400) *(1000/1400)) = 1.05

B, C are positively correlated since Lift (B, C) >1

Lift (Burgers, ^Chips)

Lift (B, ^C) = (400/1400)/ ((600/1400) *(1000/1400)) = 0.93

B, ^C are negatively correlated since Lift (B, C) <1

Lift (^Burgers, Chips)

Lift (^B, C) = (200/1400)/ ((800/1400) *(400/1400)) = 0.88

^B, C are negatively correlated since Lift (B, C) 1

Lift (^Burgers, ^Chips)

Lift (^B, ^C) = (200/1400)/ ((600/1400) *(400/1400)) = 1.17

^B, ^C are positively correlated since Lift (B, C) >1

##### Q2: Please calculate the following lift values for the table correlating shampoo and ketchup below:

- Lift (Ketchup, Shampoo)
- Lift (Ketchup, ^Shampoo)
- Lift (^Ketchup, Shampoo)
- Lift (^Ketchup, ^Shampoo)

Please also indicate if each of your answers would suggest independent, positive correlation, or negative correlation?

**Lift (B, C) = c(B->C)/s(C) = s (B u C)/(s(B) x s(C))**

Lift (Ketchup, Shampoo)

Lift (K, S) = (100/900)/ ((300/900) *(300/900)) = 1

K, S are independent since Lift (K, S) = 1

Lift (Ketchup, ^Shampoo)

Lift (K, ^S) = (200/900)/ ((600/900) *(300/900)) = 1

K, S are independent since Lift (K, S) = 1

Lift (^Ketchup, Shampoo)

Lift (^K, S) = (200/900)/ ((600/900) *(300/900)) = 1

^K, S are independent since Lift (K, S) = 1

Lift (^Ketchup, ^Shampoo)

Lift (^K, ^S) = (400/900)/ ((600/900) *(600/900)) = 1

^K, ^S are independent since Lift (K, S) = 1

## Chi Squared Analysis

##### Q3: Please calculate the following chi squared values for the table correlating burger and chips below (Expected values in brackets).

- Burgers & Chips
- Burgers & Not Chips
- Chips & Not Burgers
- Not Burgers and Not Chips

For the above options, please also indicate if each of your answer would suggest independent, positive correlation, or negative correlation?

**x2 = Σ (Observed – Expected)2 / Expected**

x2 = (900 – 800) 2/ 800 + (100-200) 2/200 + (300-400) 2/ 400 + (200-100) 2/100 = 187.5

x2 Shows Burger & Chips are correlated because the answer > 0

As ‘observed’ value is 900 and 800 is ‘expected’ can say that Burgers and Chips are positively correlated.

##### Q4: Please calculate the following chi squared values for the table correlating burger and sausages be-low (Expected values in brackets).

- Burgers & Sausages
- Burgers & Not Sausages)
- Sausages & Not Burgers
- Not Burgers and Not Sausages

For the above options, please also indicate if each of your answer would suggest independent, positive correlation, or negative correlation?

**x2 = Σ (Observed – Expected)2 / Expected**

x2 = (800 – 800) 2/ 800 + (200-200) 2/200 + (400-400) 2/ 400 + (100-100) 2/100 = 0

x2 Shows Burger & Sauces are independent because the answer = 0

As ‘expected’ and ‘observed’ value are the same can say that Burgers and Sausages are independent.

##### Q5: Under what conditions would Lift and Chi Squared analysis prove to be a poor algorithm to evaluate correlation/dependency between two events?

Lift and Chi Squared analysis wouldn’t be the best algorithms to use when there are too many Null transactions.

Please suggest another algorithm that could be used to rectify the flaw in Lift and Chi Squared?

The another algorithm that could be used to rectify the flaw in Lift and Chi Squared are ‘**Kulczynsk**i’, ‘**AllConf**‘, ‘**Jaccard**‘, ‘**Cosine**‘, ‘**MaxConf**‘.