1. Learn
  2. /
  3. Courses
  4. /
  5. HarvardX Data Science Module 4 - Inference and Modeling

Exercise

Exercise 2 - Chi-squared Test

We found that the A- polls predicted the correct winner about 80% of the time in their states and C- polls predicted the correct winner about 86% of the time.

Use a chi-squared test to determine if these proportions are different.

Instructions

100 XP
  • Use the chisq.test function to perform the chi-squared test. Save the results to an object called chisq_test.
  • Print the p-value of the test to the console.