Independence Tests for Count Data
independence_test.Rd
Perform an independence test between two categorical variables, using either the chi-squared method or Fisher's exact method.
Arguments
- formula
a formula of the form
y ~ x
, wherey
andx
are both factor variables. If not factors, they will be automatically converted. To perform test within subgroups, usey ~ x | g
.- data
a data frame containing the values in the formula.
- method
character string specifying which method to use. One of "
default
", "chisq
", or "exact
".- correct
a logical indicating whether Yates' continuity correction should be applied; used for chi-squared test only.
- ...
additional parameters, currently unused.
- x
instead of a formula, provide the matrix of counts directly.