Perform nominal/ordinal analysis on 1 dimensional table for goodnes-of-fit chi-squared, and two dimensional data for Pearson chi-squared, Fisher exact test or (if paired), McNemar test reporting their corresponding stats and effect sizes in APA Style.
Usage
contingency(
data,
x,
y = NULL,
paired = FALSE,
ratio = NULL,
conf.level = 0.95,
character.only = FALSE,
...
)
Arguments
- data
Data frame containing the variables
x
andy
.- x
Factor variable, quoted or unquoted.
- y
Factor. If
NULL
, a goodness-of-fit is carried, otherwise a two-way analysis is performed.- paired
Logical. If
TRUE
McNemar's Chi-squared test is carried on.- ratio
A vector of probabilities of the same length of x. An error is given if any entry of p is negative.
- conf.level
Confidence/Credible Interval (CI) level. Default to 0.95 (95%).
- character.only
Logical. checks whether to use the unevaluated expression or its content (when TRUE), asumming is a character vector. Defaults to
FALSE
.- ...
Currently not used.