| test.fisher | R Documentation |
Performs Fisher's Exact Test using two categorical vectors or a data frame with two columns, constructing a contingency table and optionally generating graphical visualizations.
test.fisher(
x,
y = NULL,
title = "Fisher's Exact Test",
xlab = NULL,
ylab = "Proportion",
style = c("stacked", "barplot", "mosaic", "pie"),
show_table = TRUE,
help = FALSE,
verbose = TRUE
)
x |
Categorical vector or data frame with two columns. |
y |
Categorical vector (required if x_var is a vector). |
title |
Plot title (string). Default: "Fisher's Exact Test" |
xlab |
Name of the x-axis in the plot (string). Default: NULL (uses variable name) |
ylab |
Name of the y-axis in the plot (string). Default: "Proportion" |
style |
Plot style. Controls the visualization type |
show_table |
Logical. If TRUE, prints the contingency table to the console. Default: TRUE |
help |
Logical. If TRUE, shows detailed function explanation. Default: FALSE |
verbose |
Logical. If TRUE, prints detailed test messages. Default: TRUE |
Invisible object containing the Fisher test result.
data <- data.frame(control = c("healthy","healthy","sick","sick","sick"),
treatment = c("healthy","healthy","healthy","healthy","sick"))
test.fisher(data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.