############################################# # Chapter 4 Supplemental ############################################# # Section 4.1 Example 4 CORRECTION!!! # fisher.test(success-in-sample, success-in-leftover-part, failure-in-sample, failure-in-leftover-part). fisher.test(matrix(c(300,200,3000,3000),2,2), alternative="two.sided") fisher.test(matrix(c(300,200,3000,3000),2,2), alternative="greater") # or using the hypergeomtric test # phyper(success-in-sample, success-overall, failure-overall, sample-size) phyper(299, 500, 6000, 3300, lower.tail=FALSE)