# http://stat.ethz.ch/R-manual/R-patched/library/stats/html/fisher.test.html # Creating matrix: cohesion familiarity vs. ratings > cohFam_Ratings1 <- matrix(c(41,4,26,0, 4,0,4,1), nrow = 2, ncol = 4, byrow = TRUE, dimnames = list(c("Yes", "No"), c("1st more cohesive", "2nd more cohesive", "Equally coh", "Don't know"))) > cohFam_Ratings1 1st more cohesive 2nd more cohesive Equally coh Don't know Yes 41 4 26 0 No 4 0 4 1 >cohFam_Ratings2 <- matrix(c(50,9,12,0, 4,1,3,1), nrow = 2, ncol = 4, byrow = TRUE, dimnames = list(c("Yes", "No"), c("1st more cohesive", "2nd more cohesive", "Equally coh", "Don't know"))) >cohFam_Ratings2 1st more cohesive 2nd more cohesive Equally coh Don't know Yes 50 9 12 0 No 4 1 3 1 >cohFam_Ratings3 <- matrix(c(5,41,24,1, 1,2,6,0), nrow = 2, ncol = 4, byrow = TRUE, dimnames = list(c("Yes", "No"), c("1st more cohesive", "2nd more cohesive", "Equally coh", "Don't know"))) >cohFam_Ratings3 1st more cohesive 2nd more cohesive Equally coh Don't know Yes 5 41 24 1 No 1 2 6 0 # Executing the Fisher exact test between Cohesion familiarity and Ratings > fisher.test(cohFam_Ratings1, simulate.p.value = TRUE) Fisher's Exact Test for Count Data with simulated p-value (based on 2000 replicates) data: cohFam_Ratings1 p-value = 0.1704 alternative hypothesis: two.sided > fisher.test(cohFam_Ratings1) Fisher's Exact Test for Count Data data: cohFam_Ratings1 p-value = 0.1753 alternative hypothesis: two.sided > fisher.test(cohFam_Ratings2, simulate.p.value = TRUE) Fisher's Exact Test for Count Data with simulated p-value (based on 2000 replicates) data: cohFam_Ratings2 p-value = 0.05447 alternative hypothesis: two.sided > fisher.test(cohFam_Ratings2) Fisher's Exact Test for Count Data data: cohFam_Ratings2 p-value = 0.06224 alternative hypothesis: two.sided > fisher.test(cohFam_Ratings3, simulate.p.value = TRUE) Fisher's Exact Test for Count Data with simulated p-value (based on 2000 replicates) data: cohFam_Ratings3 p-value = 0.1544 alternative hypothesis: two.sided > fisher.test(cohFam_Ratings3) Fisher's Exact Test for Count Data data: cohFam_Ratings3 p-value = 0.1523 alternative hypothesis: two.sided