Pearson's Chi-Square Test
The chi-square test performs a Pearson's chi-square test on a two-dimensional contingency table. This test is relevant to several types of null hypothesis: statistical independence of the rows and columns, homogeneity of groups, etc. The appropriateness of the test to a particular null hypothesis and the interpretation of the results depend on the nature of the data at hand, in particular on the sampling scheme.
The returned p value should be interpreted carefully. Its validity depends heavily on the assumption that the expected cell counts are at least moderately large; a minimum size of five is often quoted as a rule of thumb. Even when cell counts are adequate, the chi-square is only a large-sample approximation to the true distribution of X-squared under the null hypothesis.
If the data set is smaller than is appropriate for a chi-square test, the Fisher's exact test may be preferable.
To perform Pearson's chi-square test
Choose Statistics Compare Samples
Counts and Proportions
Chi-Square Test. The dialog shown below appears.
Pearson's Chi-Square Test has the following options:
Data Set
Specify a data set.
Variable 1
Specify the factor column that contains the first classification variable. It must have at least two levels.
Variable 2
Specify the factor column that contains the second classification variable. This variable must have at least two levels.
Data is a Contingency Table
Select if the data set specified is a contingency table.
Apply Yates' Continuity Correction
Select to apply Yates' correction for continuity. See the online Help for chisq.test for an algebraic definition of the continuity correction.
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.
Related S-PLUS language functions
chisq.test, print.htest, menuChisquare