1. Learn
  2. /
  3. Courses
  4. /
  5. R For SAS Users

Connected

Exercise

Chi-square tests

In addition to Pearson's correlations and t-tests, chi-square tests and contingency tables are useful tools to assess associations between two categorical variables. In this exercise you will create basic and customized contingency tables and perform Chi-square tests.

As explained in the preceding video, when using the dplyr pipe %>% operator, you will need to nest the table() and gmodels::CrossTable() functions inside the with() function.

The abaloneKeep dataset, dplyr and gmodels packages have been loaded for you.

Instructions 1/3

undefined XP
    1
    2
    3

Create a two-way contingency table of the frequencies of sex by age category agecat for abaloneKeep using the table() function and save the output in an object named tablesexage.