May 8, 2017

Chi Square (in Excel & Minitab) for dummies

Chi-square test : This is a test for categorical variables like the Z test which is also for proportion. Here explaining through a simple example..

There are however 2 kind of chi square test : (1) Chi Square to test the difference between 2 proportions (2) Chi Square to test the independence.

- In (1) - there were 2 or more item of interest - e.g. Purchase / Not Purchase or Return / Not Return and this compared across 2 or more locations / populations. Read the example below.
- In (2) - there are 2 or more results or variables (x) (proportions) with 2 or more levels. Will provide the example ! Click Here

While doing a project to increase sales in a electronic retail store like Chroma or Reliance Digital, one of the team member said - that if you give demo of the equipment, there is much more chances that customer will buy the equipment. We can take equipment to be a motorized pencil cutter. Experiment was conducted in 1 pilot store. No change was done in other stores.

- Store A (where experiment was done) : Total walkins : 200, conversions = 175, % conversion = 88%
- Rest of store (where experiment was not done) = Total Walkins : 2000, conversions = 1650, % conversion = 83%.

Plainly looking at the data, we can say that Store A and Store B is significantly different and that demo idea is a great idea !!


Store (Exp)All other storeTotalExpected ratio p
Purchase175165018250.83
Not Purchase253503750.17
Total20020002200


Here the null hypothesis is Store (where experiment was done) and all other stores, the conversion rate was same. To take it forward, compute the frequencies if the expected ratio of conversion (basis the total nos i.e. 1825 / 2200 = 83%) will be applicable for both the type of stores.

Store (Exp)All other storeTotal
Purchase165.91659.11825
Not Purchase34.1340.9375
Total20020002200

Now compute χ2 = Σ (Fo-Fe)^2 / Fe (Fo is observed or actual frequency and Fe is expected frequency)
Store (Exp)All other store
Purchase0.500.05
Not Purchase2.420.24
χ2 = 3.21 (0.50+0.05+2.42+0.24)
The critical value is 3.8 (can be calculated by excel formula +CHIINV(0.05,1) or from the Xisquare table). 
>> Since χ2 = 3.21 < the critical value (3.8) it means there is no significant difference between the store who did experiment and others.

Alternative to comparing the χ2 value and critical value, p value can be calculated using the formula CHIDIST()

  • Note here that although 88% and 83% are significantly different, statistically - It is not significant. 
  • Which means, that the demo experiment should be improvised before it is replicated in other store
Lets see how to do the same in minitab..







No comments:

Post a Comment