# Frequency table & chi-square test

## Description

The Frequency table and Chi-squared test can be used for the following:

### One variable - one-way classification

To test the hypothesis that for one classification table (e.g. gender), all classification levels have the same frequency. Only one discrete variable must be identified in the dialog box, and the null hypothesis is that all classification levels have the same frequency. If the calculated P-value is small (<0.05), then the null hypothesis is rejected and the alternative hypothesis that there is a significant difference between the frequencies of the different classification levels must be accepted.

### Two variables - two-way classification

To test the relationship between two classification factors (e.g. gender and profession). In this case two discrete variables must be identified in the dialog box, and the null hypothesis is that the two factors are independent. If the calculated P-value is small (<0.05), then the null hypothesis is rejected and the alternative hypothesis that there is a relation between the two factors must be accepted.

## Required input

- Variable 1 and 2: select one or two categorical or qualitative variables. These variables may either contain character or numeric codes. These codes are used to break-up the data into a two-way classification table.
- Optionally select a filter to include a subset of cases.

## Graph

Select one of the following:

- Simple column chart (one classification factor). The chart contains a single bar for each category. The height of the bars is the number of cases in the category.
- Clustered column (two classification factors). Like simple column chart, but containing a group of bars for each category in the first classification category. The height of the bars is the number of cases in the category.
- Stacked column (two classification factors). Bar segments are stacked on top of one another. There is one bar stack for each category in the first classification factor. Segments within each stack represent the contribution of categories in the second classification factor.
- 100% Stacked column (two classification factors). Bar segments are stacked on top of one another, the total equals 100%. There is one bar stack for each category in the first classification factor. Segments within each stack represent the relative contribution of categories in the second classification factor.