Chapter 12 Chi-squared

A chi-squared test is used when one wants to see if there is a realtionship between count data of two or more factors.

x <- c(A = 20, B = 15, C = 25)
chisq.test(x)
R> 
R>  Chi-squared test for given probabilities
R> 
R> data:  x
R> X-squared = 2.5, df = 2, p-value = 0.2865
R Core Team. 2017. R: A Language and Environment for Statistical Computing. Vienna, Austria: R Foundation for Statistical Computing. https://www.R-project.org/.