# Load required packages and data
library(dplyr)
data(survey_data)
# Basic 2x2 Fisher test
survey_data %>%
fisher_test(row = gender, col = region)
# Fisher test for larger table
survey_data %>%
fisher_test(row = gender, col = interview_mode)
# With weights
survey_data %>%
fisher_test(row = gender, col = region, weights = sampling_weight)
# Grouped analysis
survey_data %>%
group_by(education) %>%
fisher_test(row = gender, col = region)
Run the code above in your browser using DataLab