Class TestCasesFisherExactTest


  • public class TestCasesFisherExactTest
    extends java.lang.Object
    Test for Hypergeometric distribution and Fisher exact test
    Author:
    pcingola
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static double MAX_DIFF  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void generate_test()
      Create commands in R to run and get test results
      void test_0()  
      void test_03_fisher()  
      void test_04_fisher()  
      void test_05_fisher()  
      void test_06_fisher_vs_chi2()
      Compare Fisher exact test to Chi^2 approximation From R: > data <- matrix(c(25, 5, 15, 15), ncol=2, byrow=T) > data [,1] [,2] [1,] 25 5 [2,] 15 15 > chisq.test(data,correct=FALSE) Pearson's Chi-squared test data: data X-squared = 7.5, df = 1, p-value = 0.00617 > fisher.test(data, alternative="greater") Fisher's Exact Test for Count Data data: data p-value = 0.006349 alternative hypothesis: true odds ratio is greater than 1 95 percent confidence interval: 1.587561 Inf sample estimates: odds ratio 4.859427
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • MAX_DIFF

        public static double MAX_DIFF
    • Constructor Detail

      • TestCasesFisherExactTest

        public TestCasesFisherExactTest()
    • Method Detail

      • generate_test

        public void generate_test()
        Create commands in R to run and get test results
      • test_0

        public void test_0()
      • test_03_fisher

        public void test_03_fisher()
      • test_04_fisher

        public void test_04_fisher()
      • test_05_fisher

        public void test_05_fisher()
      • test_06_fisher_vs_chi2

        public void test_06_fisher_vs_chi2()
        Compare Fisher exact test to Chi^2 approximation From R: > data <- matrix(c(25, 5, 15, 15), ncol=2, byrow=T) > data [,1] [,2] [1,] 25 5 [2,] 15 15 > chisq.test(data,correct=FALSE) Pearson's Chi-squared test data: data X-squared = 7.5, df = 1, p-value = 0.00617 > fisher.test(data, alternative="greater") Fisher's Exact Test for Count Data data: data p-value = 0.006349 alternative hypothesis: true odds ratio is greater than 1 95 percent confidence interval: 1.587561 Inf sample estimates: odds ratio 4.859427