
Education Journalist | Study Abroad Lead
A chi-square formula is used in the Chi-square test for comparing two or more data sets in statistics. It is a statistical test to compare observed and expected data. Chi-square is a non-parametric test used to test the independence of two categorical variables.
- It is calculated by comparing the observed frequencies of each category to the expected frequencies.
- A low Chi-Square value indicates that the observed and expected data are similar.
- A high Chi-Square value indicates that the observed and expected frequencies are significantly different.
- If it’s really large, the null hypothesis of independence can be rejected.
The chi-square formula is denoted as χ2 = ∑(Oi – Ei)2/Ei, where Oi = actual value and Ei = expected value.
Read More: Root Mean Square
| Table of Content |
Key Terms: Statistics, Probability, Triangle, Area, Sets, Function, Chi-square formula, p-value
Read More- Venn Diagrams
Chi-Square Formula
[Click Here for Sample Questions]
The Chi-Square is denoted by \(\chi^2\). The chi-square formula is:
\([ \chi^2 = \sum \frac{(O_i - E_i)^2}{E_i}]\)
where
- χ2 = Chi-square statistic
- Oi = observed value (actual value)
- Ei = expected value.
- \(\displaystyle \sum\) = Summation
The formula essentially calculates the squared differences between observed (Oi) and expected (Ei) frequencies, divides each difference by the expected frequency, and then sums up these values across all categories. This statistic is crucial for evaluating the association or independence between categorical variables in a dataset.
| Example – It was tested whether there is a relationship between gender and eye colour. The data was collected from a sample of 100 people with these results:
The expected frequency for each category is calculated as follows: Expected frequency = Total number of observations * Proportion of observations in each category For example, the expected frequency for the category "Male, Brown" is: Expected frequency = 100 * (60/100) = 50 The Chi-Square test statistic is calculated as follows: Chi-Square = Σ (Oi - Ei)2 / Ei Chi-Square = (60-50)2/50 + (20-25)2/25 + (15-25)2/25 + (5-25)2/25 Chi-Square = 8 We can then compare the Chi-Square test statistic to a Chi-Square table to determine the p-value. For a Chi-Square value of 8 with 3 degrees of freedom, the p-value is 0.017. Since the p-value is less than 0.05, we reject the null hypothesis of independence and conclude that there is a significant relationship between gender and eye colour. |
Read More- Types of Sets
P-value in Chi-square Test
[Click Here for Sample Questions]
The Chi-Square test statistic is known as the P-value, short for probability value. The P-value indicates the probability of obtaining a result as extreme as or more extreme than the observed observations.
- It serves as an alternative to the rejection point for deciding when to reject the null hypothesis.
- A smaller P-value suggests stronger evidence in favour of the alternative hypothesis, considering observed and expected frequencies.
- In hypothesis testing, a low Chi-Square test score implies a close resemblance of collected data to expected data.
- A large Chi-Square test statistic indicates a poor match between observed and expected data, leading to the rejection of the null hypothesis.
- The P-value expresses the likelihood of an event occurring, and a lower P-value strengthens evidence for the alternative hypothesis.
| P-value | Description | Hypothesis Interpretation |
|---|---|---|
| P-value ≤ 0.05 | Null hypothesis – very unlikely | Rejected |
| P-value > 0.05 | Null hypothesis – very likely | Accepted or it “fails to reject”. |
| P-value > 0.05 | P-value is near cut-off- considered marginal | Hypothesis needs more attention. |
| Example – Suppose we want to test whether there is a relationship between gender and political affiliation. We collect data from a sample of 100 people and find the following results:
The expected frequency for each category is calculated as follows: Expected frequency = Total number of observations * Proportion of observations in each category For example, the expected frequency for the category "Male, Democrat" is: Expected frequency = 100 * (40/100) = 50 The Chi-Square test statistic is calculated as follows: Chi-Square = Σ (Oi - Ei)2 / Ei Chi-Square = (40-50)2/50 + (30-25)2/25 + (20-25)2/25 + (10-25)2/25 Chi-Square = 6 We can then look up the p-value for the Chi-Square test statistic of 6 and degrees of freedom of 3 in a Chi-Square table. The p-value is 0.039. |
Read More: Area of Square
Applications of Chi-Square Formula
[Click Here for Sample Questions]
A few of the most common uses of the chi-square formula are listed below.
- Biologists use it to see if two variables have a substantial relationship, such as the relationship between two species in a community.
- Genetic analysts utilize this to interpret the numbers in different phenotypic groupings.
- It is employed in a variety of statistical processes to help determine whether to accept or reject a hypothesis
- It is used to compare the occurrence of the same characteristics in two or more groups in the medical literature
Read More- Difference between Sequence and Series
Things to Remember
- Chi-square test is a non-parametric test used to compare observed and expected data.
- It tests the independence of two categorical variables, or the goodness of fit of a categorical variable to a theoretical distribution.
- It is calculated by comparing the observed frequencies of each category to the expected frequencies and squaring the difference.
- A high Chi-Square value indicates that the observed and expected frequencies are significantly different.
- A low Chi-Square value indicates that the observed and expected frequencies are similar.
- Chi-Square Formula = Σ (Oi - Ei)2 / Ei
Also Read:
Sample Questions
Ques. How to calculate p value from chi square formula? (3 marks)
Ans. To calculate the p-value from the Chi-Square formula, you need to:
- Calculate the Chi-Square test statistic using the following formula:
Chi-Square = Σ (Oi - Ei)2 / Ei
where:
- Oi is the observed frequency
- Ei is the expected frequency
- Σ is the summation symbol
- Find the degrees of freedom for the Chi-Square test. The degrees of freedom are calculated as follows:
Degrees of freedom = (number of rows - 1) * (number of columns - 1)
- Look up the p-value for the Chi-Square test statistic and degrees of freedom in a Chi-Square table.
Ques. When can chi square formula be used? (3 marks)
Ans. The Chi-Square formula can be used to –
- Test the independence of two categorical variables
- Fit of a categorical variable to a theoretical distribution
- To compare the observed and expected frequencies of a categorical variable across different groups.
Ques. A poker-dealing machine is supposed to deal cards at random, as if from an infinite deck. In a test, you counted 1600 cards, and observed the following:
Spades 404
Hearts 420
Diamonds 400
Clubs 376
Could it be that the suits are equally likely? Or are these discrepancies too much to be random? (2 Marks)
Ans. Compute each z from its own row as (observed-expected)/sqrt(expected). Be sure to use the counts in this formula, not the percentages. The chi-square statistic is the sum of the squares of the z-values. The number of degrees of freedom is 3 (number of categories minus 1). The critical value is from a table you’ll have on the exam.
Ques. Calculate the chi-square value for the following data: (4 Marks)

Ans. Now calculate Chi Square using the following formula:
\(\chi^2\) = \(\displaystyle \sum{(O-E)^2/E}\)
Calculate this formula for each cell, one at a time. For example, cell #1 (Male/Full Stop):
The observed number is: 6
The expected number is: 6.24
Therefore, (6 – 6.24)2 /6.24 = 0.0092
Continue doing this for the rest of the cells, and add the final numbers for each cell together to get the final Chi-Square number. There are 6 total cells, so at the end, you should be adding six numbers together for your final Chi-Square number.
Ques. Calculate the Chi-square value for the following data of incidences of water-borne diseases in three tropical regions. (3 Marks)

Ans. Setting up the following table:
| Observed | Expected | Oi – Ei | (Oi – Ei)2 | (Oi – Ei)2/Ei |
|---|---|---|---|---|
| 31 | 30.96 | 0.04 | 0.0016 | 0.0000516 |
| 14 | 23,04 | 9.04 | 81.72 | 3.546 |
| 45 | 36.00 | 9.00 | 81.00 | 2.25 |
| 2 | 20.64 | 18.64 | 347.45 | 16.83 |
| 5 | 15.36 | 10.36 | 107.33 | 6.99 |
| 53 | 24.00 | 29.00 | 841.00 | 35.04 |
| 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 Square = 125.516
Ques. What conclusion should be made concerning an experiment when the significance level is 0.05 (p = 0.05)? (2 Marks)
Ans. Since the p-value of 0.068 is greater than 0.05, it would fail to reject the null hypothesis. As the value of p < 0.05, the null hypothesis is rejected.
Ques. As per the survey on cars owned by each family in the locality the data has been arranged in the following table. (3 Marks)

Ans. Setting up the following table:
| Oi | Ei | (Oi – Ei)2 | (Oi – Ei)2/Ei | |
|---|---|---|---|---|
| One car | 30 | 25.6 | 19.36 | 0.645 |
| Two cars | 14 | 15.1 | 1.21 | 0.086 |
| Three cars | 6 | 5.2 | 0.64 | 0.106 |
| Total | 50 | 0.837 |
Therefore, \(\chi^2\) = \(\displaystyle \sum{(Oi-Ei)^2/Ei}\)= 0.837
Chi Square = 0.837
Ques. What does the Mean Deviation tell us? (2 Marks)
Ans. This gives us vital information about how far the values are spread from the mean value.
Ques. Determine the mean deviation for the data values 5, 3, 7, 8, 4, 9. (3 Marks)
Ans. First, we will calculate the mean of given data:
Mean = (5+3+7+8+4+9)/6
Thus, =36/6
Mean= 6
Therefore, the mean is 6.
Next, subtract the mean from the data value and do not consider any symbol.
5 – 6 = 1
3 – 6 = 3
7 – 6 = 1
8 – 6 = 2
4 – 6 = 2
9 – 6 = 3
The newly found data: 1, 3, 1, 2, 2, 3.
Finally, find the new mean,
Therefore;
= (1+3 + 1+ 2+ 2+3) /6
Mean = 12/6 =2
Hence, the Mean Deviation for the given data 5, 3,7, 8, 4, 9 is 2.
Ques. Find out the mean of the 32 numbers, if the mean of 10 of them is 15 and therefore, the mean of 20 of them is 11. The last two numbers are 10. (3 Marks)
Ans. Given that the mean of 10 numbers = 15
Therefore, Mean of 10 numbers = sum of observations/ number of observations
Hence, 15 = sum of observations/10
Next, Sum of observations of 10 numbers = 150
Therefore, Mean of 20 numbers = sum of observations/ number of observations
Hence, 11 = sum of observations / 20
Next, Sum of observations of 20 numbers = 220
Therefore, The Mean of 32 numbers = (sum 10 numbers + sum of 20 numbers + sum of last 2 numbers)/ number of observations
Finally, Mean of 32 numbers = (150 +220 + 20) / 32
= 390 /32
= 12.188
For Latest Updates on Upcoming Board Exams, Click Here: https://t.me/class_10_12_board_updates
Check-Out:






Comments