χ2 tests

When comparing two categorical variables, we can consider relative proportions using a χ2 test.

Using the sliders on the left, choose the input for the test. First, set the size of each group. For simplicity, they will be the same in this app, but in reality different group sizes are permissible. Second, select the proportion of the first variable as part of a second variable for each group.

The mosaic plots on the right will display your input as the observed frequencies. This is what our samples look like. On the left, the expected frequencies are shown. This is what we would expect to find if the proportions were indeed equal.

Below the mosaic plots, the χ2 distributuion, with some landmarks, is displayed. The blue line indicates the position of the χ2 test statistic for the specific parameters given. Details of the test are provided at the bottom of the page.