# Chi Square Calculator

The chi-square distribution is most commonly used for testing for goodness of fit between observed and expected distributions, the independence of two qualitative classifications of a population, and for the comparison of variability in quantitative data. The question that a chi-square test answers is determined by the significance of the calculated chi-square value. The significance of a chi-square value is dependent on the number of degrees of freedom available for analysis.

Suppose that you are a manager for a tortilla chip manufacturer. It is very important that your company consistently allocates the correct amount of chips in every bag. Of course it is nearly impossible to ensure that every bag has the same number of chips, so there is a certain amount of variability that is unavoidable. Unfortunately, the equipment that dispenses the chips for every bag has needed some repair work done. You want to make sure that it is working properly before you bring it back online.

You have decided that the weight range of chips per bag, marketed as 16oz, should be between 15.75 and 16.25 ounces. The standard deviation of the product weight for all bags sold should be maintained around 0.15. After collecting 50 sample bags, you have calculated that the machine has a standard deviation of 0.23 ounces per bag. Although the standard deviation for the 50 sample bags is larger than the desired population standard deviation for ounces of chips per bag, that difference may not be real since you only tested a small sample. In order to test for equality, you use the chi-square test. The chi-square is calculated by (df x Sample variance) / population variance or:

X2 = ((50-1) * (0.23)2/(0.15)2 = 115.11

The P value, which indicates the significance of the chi-square, was calculated to be <0.0001. Any P value below 0.05 indicates that the observed differences are in fact significant. With this information, you have decided that the chip dispenser has too much variability to be used and must be re-calibrated before it can resume production.