Chi-squared (x²) Goodness of Fit test
The Goodness of Fit test is used to establish whether an hypothesized distribution function fits the sample data. The data for this test consist of N independent observations of a random variable which are grouped into c classes. The measurement scale must be at least nominal. If the number of observations in any one cell is very low, the observations may be combined into adjacent cells.
Script operation
This tool operates in much the same way as most of the others but with specific departures from the usual methods. The script requires that the Observed frequencies be in column 1, while the second column contains either Expected frequencies or the Probabilities. The script will ask the user to indicate which type of data is in column 2.
Note that if Probabilities are used, the total of all probabilities must add up to either 1 or 100, or the script will detect an error condition.
Look at the other Chi-squared Goodness of Fit Test which allows the user to group the raw data into classes to calculate the Expected frequencies.
The script also allows the user to vary the degrees of freedom used in the calculations. A requester will open allowing the user to indicate a number to be subtracted from the calculated df (which is the number of rows -1). The script will not allow less than 1 degree of freedom to be used!
Click here for information about general script usage.
The script operates on raw data which is arranged in columns. Note that sample titles may be included within the input range but will not be used on output.
The following shows the same observed data in two examples, one using Expected frequencies and the other using Probabilities. The output is the same for both examples.
Example 1 Cell Observed F Expected F 1 20 20 2 14 20 3 18 20 4 17 20 5 22 20 6 29 20 Example 2 Cell Observed F Probability 1 20 0.16666666666667 2 14 0.16666666666667 3 18 0.16666666666667 4 17 0.16666666666667 5 22 0.16666666666667 6 29 0.16666666666667
The output:
Chi-Sq Goodness of Fit Residuals 0 -1.3416 -0.4472 -0.6708 0.4472 2.0125 Chi-Square: 6.7 d.f.: 5 P(CHI<=chi): 0.756075 Chi-Critical (95%): 11.0705 Chi-Critical (99%): 15.0863
Interpretation