Courses
Courses for Kids
Free study material
Offline Centres
More
Store Icon
Store

How To Calculate Chi-Square?

Reviewed by:
ffImage
hightlight icon
highlight icon
highlight icon
share icon
copy icon
SearchIcon

What Is Chi-Square Formula?

A chi-square test definition is as follows, it is a type of data analysis that is done on the basis of the observations of a certain type of random set of variables. It is symbolically represented as ${\chi}^2$. Usually, it is done as a comparison of two statistical data sets. This test was introduced by mathematician and statistician Karl Pearson in the year 1900 for categorical data analysis and distribution. So it was mentioned as Pearson’s chi-squared test.


The chi-square test is widely used to determine how likely the observations that are made on samples would be, by considering whether the assumption of the null hypothesis is true. In this hypothesis is a consideration that a given condition or statement might be true, where it can be tested afterwards. Chi-squared tests are created usually from a sum of squared errors or falsities over the sample variance.


Now we know the definition of chi square value, now let us see what is the formula for chi square, how to calculate chi square value.


Chi-Square Test Formula

The chi-squared test is done in order to check the difference that is present between the observed value and expected value. The chi-square formula can be written as;

${\chi_c}^2 = \sum {\frac{({O_i} - {E_i})^2}{E_i}}$

Here the subscript “c” represents the degree of freedom. “O” represents the observed value and “E” represents the expected value. To find a critical value of chi-square by hand this formula is used rarely. The summation symbol in the formula represents performing a calculation for each and every single data sample in the data set. As one can probably imagine, the calculations can be very lengthy and tedious. Probably instead of this, we want to use technology:

  • Chi-Square Test in SPSS.

  • Chi-Square P-Value in Excel.

A chi-square statistic is one of the ways to represent the relationship between two categorical variables. A chi-squared statistic is found to be a single number that provides the difference that exists between observed counts and the expected count.


There are a few variations that are found in the chi-square statistic. Which one to use depends upon the method of the data collected and the hypothesis that is being tested. However, all of these variations use the same idea of comparing the expected values with the values that are collected actually. One of the most common forms that can be used for contingency tables:

${c}^2 = \displaystyle\sum\limits_{i=1}^k [ {\frac{({O_i} - {E_i})^2}{E_i}}]$

Where “O” is represented as the observed value, “E” is represented as the expected value, and “i” is the “ith” position in the contingency table.


If a chi-square value is less then there will be a high correlation found between two sets of data. In theory, if there is no difference between observed and expected values then the chi-square value would be zero, this means it is an event that does not happen in real life. It is not that easy to decide whether a chi-square test statistic is enough to indicate a statistically significant difference. Take the calculated chi-square value and compare it with the critical value found in a chi-square table. If the calculated chi-square value is more when compared to the critical value, then there is a significant difference.


Properties of chi-square test

The following are the important properties of the chi-square test:

  • Variance is equal to twice the number of degrees of freedom.

  • The degree of freedom is equal to the mean distribution.

  • The chi-square distribution curve is found to approach the normal distribution curve when there is an increase in the degree of freedom.


Types of Chi-square test formula

There are two types of chi-square tests, where both these tests are used for the chi-square distribution and statistics for different purposes:

  • The Chi-square goodness of fit test helps to determine whether the given sample data matches with a population.

  • A chi-square test for independence is used to compare two variables that are present in a contingency table to see if they are related. In a general sense, it tests to see whether the distributions that are related to categorical variables differ from each other. The chi-square test of independence is also known as the chi-square test of association which can be used to determine the association found between the categorical variables. It is also considered a non-parametric test. This test is mostly used to test statistical independence.


The chi-square test of independence is not an appropriate one when the categorical variables are there to represent the observations of pre-test and post-test. To perform this test, the given data must satisfy the following requirements:

  • It should have two categorical variables.

  • The sample size should be relatively large.

  • Categories of variables.

  • The data should be independent of observations.


Applications

A few of the applications of the chi-square formula are given below:

  • Some biologists used it to determine the significant association between the two variables. For example, to find the association between species of the community.

  • Genetic analysts used to find the various numbers in the phenotypic classes.

  • In order to hold onto or reject any hypothetical results, it is been used in various statistical procedures.

  • In medical literature, it is used to compare the characteristics shared by the two or more groups


Solved Examples

Calculate the Chi-square value for the following data of incidences of water-borne diseases in three tropical regions.



India

Equador

South Africa

Sum

Cholera

31

45

14

90

Typhoid

2

53

5

60

Diarrhea

53

45

2

100


86

64

100

250


Solution:


Observed

Expected

$({O_i} - {E_i})$

(oi-ei)2 $({O_i} - {E_i})^2$

${\frac{({O_i} - {E_i})^2}{E_i}}$

31

30.96

0.04

0.0016

0.0000516

45

36.00

9.00

81.00

2.25

14

23.04

9.04

81.72

3.546

2

20.64

18.64

347.45

16.83

53

24.00

29.00

841.00

35.04

5

15.36

10.36

107.33

6.99

53

34.40

18.60

345.96

10.06

45

25.60

19.40

376.36

14.70

2

40.00

38.00

1444.00

36.10


${\chi_c}^2 = \sum {\frac{({O_i} - {E_i})^2}{E_i}}$

= 125.516


Practice Questions

1. The parameter of Chi-Square distribution is

  1. degrees of freedom

  2. a number of rows

  3. number of cells

  4. a number of columns

Ans: Option a


2. The value of chi-square distribution is

  1. Negative

  2. 0

  3. Positive

  4. None of these options

Ans: Option a


Facts

  • The test statistic for any Chi-square distribution will be greater than or equal to zero.

  • For each and every different value of df, the distribution curve will be different.


Conclusion

In chi-square test notes, we learned about chi-square tests, their types, properties, and how to calculate them? Let us recall that Chi-squared tests are often referred to as tests for which the distribution of the samples of test statistic approaches the x2 distribution asymptotically. This means that the sampling distribution of the test statistic is the null hypothesis and if it is true, it approximates a chi-squared distribution more and more closely as sample sizes increase.

FAQs on How To Calculate Chi-Square?

1. How do you calculate chi square?

The value of the Chi-squared statistic can be calculated using the formula given below:

${\chi_c}^2 = \sum {\frac{({O_i} - {E_i})^2}{E_i}}$


This can be done as follows.

  • For each of the observed values in the data, subtract each of the corresponding expected values, that is (O — E).

  • After subtracting the square the difference that was found, it is represented as (O - E)2.

  • Divide this square value by the expected value of each of the observations, it is represented as ${\frac{({O} - {E})^2}{E}}$.

  • Finally, take the sum of these values to obtain the value of the chi-squared statistic.

2. What is the Chi-square test? Write down the Chi-square test formula.

A chi-square test definition is as follows, it is a type of data analysis that is done on the basis of the observations of a certain type of random set of variables.


The Chi-square test formula is ${\frac{({O_i} - {E_i})^2}{E_i}}$.

4. What is the Difference between the chi square test and the t-test?

Both these t-tests and the chi-square tests are statistical tests. This test is basically designed to test or if possible then reject the null hypothesis. The null hypothesis is usually a statement that indicates that something is zero or something does not exist. Like you can test that there is a difference between two means and that is zero or that there is no relationship between the two variables.