Skip to content

Instantly share code, notes, and snippets.

@NyaGarcia
Created March 18, 2020 16:07
Show Gist options
  • Save NyaGarcia/caa3376f68e6fda491d5ba3a17de618d to your computer and use it in GitHub Desktop.
Save NyaGarcia/caa3376f68e6fda491d5ba3a17de618d to your computer and use it in GitHub Desktop.
Performing the pearson chi-square test for independence between gears and cylinders
> chisq.test(mtcars$gear, mtcars$cyl)
Pearson's Chi-squared test
data: mtcars$gear and mtcars$cyl
X-squared = 18.036, df = 4, p-value = 0.001214
Warning message:
In chisq.test(mtcars$gear, mtcars$cyl) :
Chi-squared approximation may be incorrect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment