# http://stat.ethz.ch/R-manual/R-patched/library/stats/html/fisher.test.html # Creating matrix: academic degree vs. cohesion familiarity >cohFam_AcadDegree <- matrix(c(2,20,10,31,8,0, 0,5,1,2,1,0), nrow = 2, ncol = 6, byrow = TRUE, dimnames = list(c("Yes", "No"), c("Undergrad", "Grad", "Grad Cert Expert", "Master", "PhD", "No degree"))) > cohFam_AcadDegree Undergrad Grad Grad Cert Expert Master PhD No degree Yes 2 20 10 31 8 0 No 0 5 1 2 1 0 # Executing the Fisher exact test between Academic degree and Cohesion Familiarity > fisher.test(cohFam_AcadDegree, simulate.p.value = TRUE) Fisher's Exact Test for Count Data with simulated p-value (based on 2000 replicates) data: cohFam_AcadDegree p-value = 0.5512 alternative hypothesis: two.sided > fisher.test(cohFam_AcadDegree) Fisher's Exact Test for Count Data data: cohFam_AcadDegree p-value = 0.5464 alternative hypothesis: two.sided