Fundamentals of Statistics contains material of various lectures and courses of H. Lohninger on statistics, data analysis and chemometrics......click here for more. 
Home Statistical Tests Comparing Distributions ChiSquare Test  
See also: survey on statistical tests, KolmogorovSmirnov test, tests for normality, distribution calculator  
ChiSquare Test
The easiest way to compare distributions is to compare them visually. We overlay a histogram of the data with the theoretical distribution with which it is to be compared. Of course this approach lacks statistical justification. A sound method to compare empirical and known (parametric) distribution is the χ^{2}test. One practical problem is that the evaluation of parametric distribution functions results in probabilities instead of frequencies. In order to compare the empirical and theoretical distribution we have to to estimate the expected frequencies by multiplying the theoretical probabilities by the number of samples.
The probability that the variable falls into a bin [a_{i},a_{i+1}] is the difference of the probabilities of x being less than the bin boundaries a_{i} and a_{i+1}, respectively: Prob(a_{i} < x < a_{i+1}) = Prob(x < a_{i+1})  Prob(x < a_{i})
For each bin, the squared difference between the frequencies of the empirical and the theoretical distribution are calculated. The squared differences are divided by the expected frequencies. The sum of these relative or weighted squared differences is the χ^{2} statistic. The null hypothesis is that the two distributions are the same, and the differences are due to random errors.


Home Statistical Tests Comparing Distributions ChiSquare Test 
Last Update: 20121008