Chi-square tests output
In chapter 3, you performed a chisq.test() of sex by agecat. In this exercise, you will perform the test again and save the output as cssexage and then display selected elements from the output list object.
The abaloneKeep dataset and dplyr package have been loaded for you.
แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร
R For SAS Users
คำแนะนำการฝึกหัด
- Save the
table()output of the two-way frequencies of sex by age category forabaloneKeepastablesexage. - Run
chisq.test()usingtablesexageand save the output ascssexage. - Display the
expectedvalues andp.valuefromcssexageoutput.
แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ
ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์
# Create frequency table of sex by agecat
tablesexage <- ___ %>%
with(___)
# Chi-square test using tablesexage
cssexage <- ___
# Display expected values and p.value from cssexage
___
___