16 Analysis of Two-Way Contingency Tables

Instructions for analysis of two-way contingency tables in Rguroo

  1. Use a dataset in your Rguroo account or recreate the example below by importing the HairEyeColor dataset from the Rguroo dataset repository called R Dataset into your account.
Click here to see a portion of the dataset. Screenshot of the first 5 rows of the Hair eye color dataset.


  1. Open the Analytics toolbox on the left-hand side of the Rguroo window. Use the Analysis dropdown menu and choose Contingency Table (see Figure 16.1) .

  2. Select a Dataset.

  3. From the Factor 1 and Factor 2 dropdowns, select the categorical variables. If your data is in tabular form where frequencies are given in a separate column, select your Frequency variable.

  4. Under the Test of Independence section, select a method (with graph, if desired). Also, set the Significance Level.

  5. (Optional) Select Mosaic Plot.

  6. Click the Preview icon preview icon to view the result.

A Screenshot of Analysis of two-way contingency table dialog

Figure 16.1: Analysis of two-way contingency table dialog