One-sample Chi-Square Goodness Of Fit Test
The chi-squared goodness of fit test uses Pearson's chi-squared statistic to test whether the empirical distribution of a set of observations is consistent with a random sample drawn from a specific theoretical distribution.
Chi-squared tests apply to any type of variable: continuous, discrete, or a combination of these. For large sample sizes (n > 50), if the hypothesized distribution is discrete, the chi-squared test is the only valid test. In addition, the chi-squared test easily adapts to the situation in which parameters of a distribution are estimated. However, especially for continuous variables, information is lost by grouping the data.
When the hypothesized distribution is continuous, the Kolmogorov-Smirnov test is more likely to reject the null hypothesis when it should-it is more powerful than the chi-squared test-and hence it is preferred.
To perform a one-sample chi-square goodness-of-fit test
Choose Statistics Compare Samples
One Sample
Chi-Square GOF. The dialog shown below appears.
The one-sample chi-square goodness-of-fit test has the following options:
Data
Data Set
Select a data set from the dropdown list or type the name of a data set. You can also type into the Data Set edit field any expression that evaluates to a data set.
Variable
Select the column to which the test will be applied.
Options
Number of Classes
Enter the number of cells into which the observations are to be allocated according to the hypothesized distribution for the variable. If Cut Points are supplied, Number of Classes is set to the number of cut points minus 1.
Cut Points
Enter a vector of cut points for the cells.
Number of Parameters Estimated
Enter the number of parameters to be estimated from the data. This affects the number of degrees of freedom associated to the test statistic.
Hypotheses
Distribution
Selected the hypothesized distribution for the variable.
Results
Enter the name for the object in which to save the results of the analysis.
Print Results
Select this to print out the results of the analysis in the designated output window.
Distribution Parameters
When a distribution is chosen, fields for those parameters associated with the distribution are enabled.
Related S-PLUS language functions
chisq.gof, ks.gof, qqplot