# Chi-Square Test of Independence

## 1. Testing the association between two nominal variables

When measuring the association between two nominal variables, one can choose between using a Chi-square test or a Fisher’s Exact test. For instance, the Chi-square test is more appropriate when less than 20% of the cells to have expected count <5. If this assumption is violated, the Fisher’s Exact test could be more suitable.

### Chi-Square Test of Independence

Null Hypothesis: The two variables are independent of each other.

Alternative Hypothesis: The two variables are related with each other.

## 2. Formula for Chi-Square Test of Independence

Chi-square statistics = Summation of (Oi – Ei)^2/Ei

## 3. Decision rules for Chi-Square Test of Independence

For such test, one can determine whether or not to reject the null hypothesis by comparing the test statistics they calcuated with the critical value. The null hypothesis will be rejected if the test statistics is more than the critical value.

**Exercise**

Conduct a Chi-Square test for the following set of data and determine whether the null hypothesis is rejected.

Question 1

v1 | v2 |

2 | 2 |

1 | 2 |

2 | 1 |

1 | 1 |

1 | 2 |

2 | 2 |

2 | 1 |

2 | 2 |

1 | 2 |

2 | 2 |

1 | 2 |

2 | 2 |

1 | 1 |

1 | 1 |

2 | 2 |

1 | 1 |

2 | 1 |

2 | 1 |

1 | 1 |

1 | 1 |

2 | 1 |

1 | 1 |

1 | 2 |

1 | 1 |

2 | 2 |

1 | 2 |

2 | 1 |

1 | 2 |

2 | 2 |

2 | 2 |

1 | 2 |

2 | 2 |

2 | 1 |

1 | 2 |

1 | 2 |

1 | 2 |

1 | 2 |

2 | 2 |

1 | 1 |

1 | 2 |

2 | 2 |

2 | 2 |

2 | 2 |

1 | 1 |

2 | 2 |

2 | 1 |

2 | 1 |

1 | 1 |

2 | 1 |

Question 2

v3 | v4 |

1 | 2 |

1 | 1 |

2 | 2 |

1 | 1 |

2 | 1 |

2 | 1 |

2 | 2 |

2 | 1 |

2 | 2 |

1 | 2 |

1 | 2 |

2 | 1 |

1 | 2 |

2 | 1 |

1 | 1 |

1 | 1 |

1 | 1 |

1 | 1 |

2 | 2 |

2 | 2 |

2 | 1 |

2 | 1 |

2 | 2 |

1 | 1 |

1 | 1 |

2 | 2 |

1 | 1 |

1 | 2 |

2 | 2 |

1 | 1 |

1 | 2 |

2 | 1 |

2 | 1 |

2 | 2 |

1 | 2 |

2 | 2 |

2 | 1 |

2 | 1 |

1 | 2 |

2 | 1 |

2 | 1 |

1 | 2 |

1 | 2 |

2 | 2 |

2 | 1 |

1 | 2 |

1 | 1 |

1 | 2 |

2 | 1 |

Question 3

v5 | v6 |

2 | 2 |

2 | 1 |

1 | 1 |

1 | 2 |

1 | 2 |

1 | 1 |

1 | 1 |

1 | 1 |

2 | 1 |

2 | 1 |

2 | 2 |

2 | 2 |

2 | 1 |

2 | 2 |

2 | 1 |

1 | 2 |

1 | 2 |

2 | 1 |

1 | 1 |

2 | 1 |

1 | 2 |

1 | 2 |

2 | 1 |

2 | 2 |

1 | 2 |

1 | 2 |

2 | 2 |

2 | 2 |

1 | 2 |

1 | 2 |

2 | 2 |

1 | 1 |

2 | 2 |

1 | 2 |

2 | 2 |

1 | 1 |

1 | 2 |

2 | 1 |

2 | 2 |

1 | 1 |

1 | 1 |

2 | 2 |

1 | 2 |

1 | 2 |

2 | 2 |

2 | 1 |

1 | 2 |

2 | 2 |

2 | 1 |

Question 4

v7 | v8 |

1 | 1 |

1 | 1 |

1 | 2 |

1 | 2 |

1 | 1 |

1 | 1 |

1 | 1 |

1 | 1 |

2 | 2 |

1 | 1 |

2 | 1 |

1 | 2 |

2 | 2 |

2 | 2 |

2 | 1 |

2 | 2 |

1 | 2 |

1 | 1 |

2 | 1 |

2 | 2 |

1 | 2 |

1 | 1 |

2 | 2 |

2 | 1 |

2 | 1 |

1 | 1 |

2 | 1 |

1 | 2 |

2 | 2 |

2 | 2 |

2 | 2 |

2 | 2 |

2 | 1 |

2 | 1 |

2 | 1 |

1 | 1 |

2 | 1 |

2 | 2 |

1 | 2 |

2 | 2 |

1 | 1 |

1 | 1 |

1 | 1 |

1 | 1 |

1 | 2 |

2 | 1 |

1 | 2 |

2 | 1 |

1 | 1 |

Question 5

v9 | v10 |

2 | 2 |

1 | 2 |

1 | 2 |

1 | 2 |

2 | 2 |

1 | 2 |

1 | 1 |

1 | 2 |

2 | 1 |

1 | 2 |

1 | 2 |

2 | 2 |

2 | 2 |

1 | 1 |

2 | 1 |

2 | 1 |

1 | 2 |

2 | 2 |

1 | 1 |

1 | 2 |

1 | 1 |

1 | 2 |

1 | 1 |

1 | 2 |

2 | 2 |

2 | 1 |

1 | 1 |

2 | 2 |

1 | 1 |

2 | 1 |

1 | 2 |

1 | 2 |

1 | 2 |

2 | 2 |

1 | 2 |

2 | 2 |

2 | 1 |

1 | 2 |

1 | 2 |

2 | 1 |

1 | 2 |

2 | 2 |

2 | 2 |

2 | 1 |

2 | 1 |

1 | 2 |

2 | 2 |

2 | 1 |

1 | 1 |

Question 6

v11 | v12 |

1 | 1 |

2 | 1 |

2 | 2 |

1 | 1 |

2 | 2 |

2 | 2 |

2 | 2 |

2 | 1 |

2 | 2 |

2 | 2 |

1 | 1 |

2 | 1 |

1 | 1 |

1 | 1 |

2 | 1 |

1 | 2 |

1 | 2 |

1 | 2 |

1 | 2 |

2 | 2 |

2 | 2 |

2 | 1 |

1 | 2 |

2 | 1 |

1 | 1 |

2 | 1 |

2 | 1 |

1 | 2 |

1 | 2 |

2 | 1 |

1 | 2 |

1 | 2 |

1 | 1 |

2 | 1 |

1 | 2 |

2 | 1 |

2 | 1 |

2 | 2 |

1 | 2 |

1 | 1 |

1 | 1 |

1 | 2 |

1 | 2 |

1 | 2 |

2 | 2 |

2 | 1 |

2 | 1 |

2 | 1 |

2 | 2 |

**Answer**

- p-value = 0.680, do not reject the null hypothesis
- p-value = 0.490, do not reject the null hypothesis
- p-value = 0.644, do not reject the null hypothesis
- p-value = 0.322, do not reject the null hypothesis
- p-value = 0.253, do not reject the null hypothesis
- p-value = 0.195, do not reject the null hypothesis

## About the Singapore Math Tutor - Dr Loo

I am a PhD holder with 9 years of teaching experience on teaching quantitative subjects at secondary school and university levels. My expertise are mathematics, statistics, econometrics, finance and machine learning.

Currently I do provide consultation and tuition for math tuition in Singapore. If you are looking for secondary math tutor in Singapore, JC H2 math tutor or statistics tutor in Singapore, please feel free to contact me at +65-85483705 (SMS/Whatsapp).

Among the Singapore math tuition that I provide, this includes Singapore secondary math tuition (E-math tuition & A-math tuition) and also JC Math Tuition (H1 Math Tuition & H2 Math Tuition). On the other hand, my statistics tuition in Singapore mostly focus on pre-university level until postgraduate level. For those who are looking for online tutoring service, the online O-level math tuition and online A-level math tuition are also available.

## For those who are looking for math tution in Singapore

Need help with this topic? I do provide mathematics home tuition in Singapore for O-level math and also JC H2 math. In addition, online math tutoring is available as well. Feel free to contact me if you would like to know further.