fisher_needed: Is Fisher's exact test needed

View source: R/fisher_needed.R

fisher_neededR Documentation

Is Fisher's exact test needed

Description

Check wether Fisher's exact test is needed (or chi-square is ok)

Usage

fisher_needed(x = NULL, y = NULL, threshold = 5L, full_report = FALSE)

Arguments

x

first variable, a table or a matrix

y

second variable

threshold

cutoff value under indipendence

full_report

return a full report or only the TRUE/FALSE answer

Examples

test <- matrix(c(1, 20, 15, 3), byrow = TRUE, ncol = 2)
fisher_needed(test)
fisher_needed(as.table(test))

TeaTasting <- matrix(c(3, 1, 1, 3), nrow = 2,
                     dimnames = list(Guess = c("Milk", "Tea"),
                                     Truth = c("Milk", "Tea")))
fisher_needed(TeaTasting)

lbraglia/lbstat documentation built on May 9, 2024, 7:24 p.m.