chi_square: Pearson's Chi-squared test

View source: R/chisq.R

chi_squareR Documentation

Pearson's Chi-squared test

Description

Convenience function for stats::chisq.test(). Returns only the p-value if pvalue is set to TRUE (default), otherwise returns a list with class "htest"

Usage

chi_square(vals, pvalue = T, correct = FALSE)

Arguments

vals

an integer vector of numerator (odd elements), denominator (even elements) pairs

pvalue

a logical TRUE: return only p-value | FALSE: return list from chisq.test

correct

a logical indicating whether to apply continuity correction when computing the test statistic for 2 by 2 tables

Value

numeric p-value or list with class "htest"

Examples

v<-c(c(100,144),c(200,344),c(75,130))
orrr::chi_square(v)


JahNorr/orrr documentation built on Jan. 29, 2025, 5:11 p.m.