Chi Square Formula

Chi Square Test

In statistics, various measuring methods are widely used. A chi-square test is required for many experimental studies to conclude. It is a very useful non-parametric statistic. The chi Square test formula is used to collect data from people who are divided into several categories. And to know if the distribution differs from what one may predict.

[Image will be Uploaded Soon] 

What is Chi Square?

The difference between actual and predicted data values are calculated using the chi square test formula, which is used in statistics. It's used to see how closely real and predicted data correlate. The chi-square value will help us in determining the statistical significance of the discrepancy between predicted and actual data. A small chi-square value indicates that any differences between the actual and expected data are due to chance.


As a result, the data is not statistically significant. A large value also indicates that the data is statistically significant and that something is causing the data differences. A statistician can then look at the reasons that might be generating the differences.

[Image will be Uploaded Soon] 

Chi Square Formula

As we can see in the chi square distribution formula, Chi is a Greek symbol that looks like the letter x. To calculating chi square, multiply the square of the difference between the observed O and expected values E then divide it by the expected value E. We end up with two or more values depending on the number of categories in the input. The sum of these numbers is the Chi-square. We don't need to take the square root because the number we're searching for is chi-square.


A small Chi square test equation indicates that the mean data fits the expected data very well statistically. A large Chi square test formula indicates that the data does not fit well statistically. We must reject the null hypothesis if the chi-square value is very large. One way to show the relationship between two categorical variables is using the Chi square formula. In statistics, there are two types of variables: numerical variables and non-numerical variables.

The chi square test statistic formula is as follows,

χ2 = \[\sum\frac{(O-E){2}}{E}\]

Where,

O: Observed frequency

E:  Expected frequency

∑ : Summation

χ2 : Chi Square Value


Expected Frequency for Chi Square Equation

In contingency table calculations, including the chi-square test, the expected frequency is a probability count. Standardized residuals are calculated using expected frequencies, in which the expected count is subtracted from the observed count in the numerator. 

  • Observed Frequencies: Counts of experimental data are called observed frequencies. Or look at it another way, you actually observe the data and take measurements.

  • Expected Frequency: Expected Frequencies are a type of frequency that may be calculated using probability theory.

The expected frequency formula is as follows,

Eij = \[\frac{T_{i} x T_{j}}{N}\]

Where, 

Eij = Expected frequency for the ith row/jth column.

Ti = Total in the ith row

Tj = Total in the jth column

N = Net Total


Solved Examples

Example.1. Which Pet Will You Prefer?



Dog

Cat

Male

201

208

Female

206

210


Solution:

Firstly, Make a Table Using the Given Data,


Dog

Cat

Male

201

208

Female

206

210


Now, Add Rows and Columns, We Get,



Dog

Cat

Total

Male

201

208

409

Female

206

210

416

Total

407

418

825


Now, calculate the expected value for each entry by using the expected frequency formula,

Eij = \[\frac{T_{i} x T_{j}}{N}\]



Dog

Cat

Total

Male

201.77

207.23

409

Female

205.23

210.77

416

Total

407

418

825


Now calculating chi square value, subtract expected from actual value, square it, then divide by expected value by using chi square statistic formula,

The chi square formula is as follows,

χ2 = \[\sum\frac{(O-E){2}}{E}\]



Dog

Cat

Total

Male

0.0029

0.0028

409

Female

0.0028

0.0028

416

Total

407

418

825


Now, Add All Chi-Squared Values,

0.0029 + 0.0028 + 0.0028 + 0.0028 = 0.0113

Hence the chi-square value is very small; its mean data fits the expected data very well statistically.

FAQs (Frequently Asked Questions)

Q.1) Where Do We Use the Chi Square Test?

Answer: The Chi-Square test is a statistical method used by researchers to compare categorical variables within the same population. Consider the case of a study organisation that wants to know if education level and marital status are related for all people in the United States.

Q.2) How Do You Use a Chi Square Table?

Answer: In summary, here are the methods to get a chi-square value using the chi-square table:

  • Find the row that corresponds to the degrees of freedom in question.

  • Look for the column headed "probability of interest".

  • Find the chi-square value where the probability column and the row intersect.