Chi-Square Test for Independence

By Anthony M. Wanjohi

Chi-square is used either to analyze whether a frequency distribution for a categorical variable, say sex is consistent with expectations (a goodness of fit test), OR whether two categorical variables are significantly associated with each other (a test for independence). Chi square test for independence is used to test two categorical variables from a single population (StatTrek, 2015),). This article provides an overview of chi square test for independence. The first part of the article presents assumptions before using an example to illustrate the test.

Chi square assumptions

The general assumptions about Chi Square are that: a) Chi-square statistic does not give any information about the strength of the relationship, b) Chi-square statistic only conveys the existence or nonexistence of the relationships or association between the variables investigated, c) Chi-square statistic compares counts (frequencies) and not means. 

Typically, chi square test assumes the following:

a)      Use of frequency data,

b)      The two variables under study must be categorical,

c)      Expected frequency counts for each cell must be NOT less than 5 and

d)      The sample size should be representative.

Statement of hypotheses for Chi square test for independence is as follows:

H0: Variable A and Variable B are independent.
Ha: Variable A and Variable B are not independent


In order to gain a better understanding of chi-square test for independence, an hypothesis is stated from the null. A statistical application, namely SPSS is used to run the test.

H0:  There is no statistically significant association between gender and preferred mode of learning.


Since the obtained level of significance for the association between Gender and Preferred Mode of Learning is greater than 0.05, χ² (5, N = 149) = 2.255, p = .813, the null hypothesis is not rejected. The study therefore concludes that there is no significant association between Gender and Preferred Mode of Learning. This implies that the preferred mode of learning is independent of gender; that is males and females equally prefer online learning and regular classroom learning. 


Sources for Further Reading

Lund Research (2013). Chi-Square Test for Association using SPSS Statistics. Available online at

StatTrek (2015). Chi square test for independence. Retrieved from

Wielkiewicz, R.M. (2000). SPSS Online Guide. Available online at