Current location - Education and Training Encyclopedia - Graduation thesis - How to calculate chi-square test?
How to calculate chi-square test?
Chi-square value indicates the deviation between the observed value and the theoretical value. The basic idea of calculating this deviation is as follows.

Let A represent the observation frequency of a certain category, E represents the expected frequency calculated based on H0, and the difference between A and E is called residual.

Obviously, the residual can represent the deviation between the observed value and the theoretical value of a certain category, but if the residual is simply added to represent the difference between the observed frequency and the expected frequency of each category, there is a certain deficiency. Because there are positive and negative residuals, the sum will cancel each other out, and the total is still 0. Therefore, we can square and sum the residuals.

On the other hand, surplus size is a relative concept. When the expected frequency is 10, the residual of the expected frequency is very large, while when the expected frequency is 1000, the residual is very small. In view of this, people divide the square of the residual by the expected frequency and then sum it to estimate the difference between the observed number and the expected number.

(Reference source: edited by Zhang and Kuang Chunwei. Basic course of SPSS statistical analysis (second edition)

The results of SPSSAU are as follows:

The chi-square value is calculated as follows:

Where A represents the observation frequency of a certain category, E represents the expected frequency calculated based on H0, ai is the observation frequency of Class I, Ei is the expected frequency of Class I, N is the total frequency, and pi is the expected frequency of Class I.. When n is relatively large, χ2 statistics approximately obey the chi-square distribution of k- 1 degrees of freedom.