# Cook et al. Human-Wildlife Conflicts with Freshwater Piscivores # R code for Fisher's exact tests # Contingency tables created excluding 'Conflict severity' = 'Data Deficient'; 'IUCN' = 'Not Assessed'; and 'Body Mass' = (blank). # Total sample size: N = 31 species. # Severity of conflict across IUCN categories iucn.data <- matrix(c(4,5,3,4,1, 3,0,0,0,4, 0,0,1,0,4, 0,0,2,0,2), ncol=4, nrow=5, dimnames=list(conflict = c("CR", "EN", "VU", "NT", "LC"), iucn = c("Low", "Moderate", "High", "Severe"))) fisher.test(iucn.data) # p-value = 0.007272 # Severity of conflict across body mass categories bm.data <- matrix(c(5,5,7, 0,6,1, 0,2,3, 0,0,4), ncol=4, nrow=3, dimnames=list(conflict = c("<10", "10-49", ">50"), bm = c("Low", "Moderate", "High", "Severe"))) fisher.test(bm.data) # p-value = 0.03336