เริ่มต้นใช้งานเริ่มต้นใช้งานได้ฟรี

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.

แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร

R For SAS Users

ดูคอร์ส

แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ

ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์

# Create frequency table of sex by agecat
___ <- ___ %>% 
  with(___)
แก้ไขและรันโค้ด