示例#1
0
	def testOddsRatio(self):
		"""Verify computation of Odds ratio effect size filter"""
		from plugins.samples.effectSizeFilters.OddsRatio import OddsRatio
		oddsRatio = OddsRatio(preferences)
		
		# Ground truth calculated by hand
		value = oddsRatio.run(table1[0], table1[1], table1[2], table1[3])
		self.assertAlmostEqual(value, 2.0)
		
		value = oddsRatio.run(table2[0], table2[1], table2[2], table2[3])
		self.assertAlmostEqual(value, 1.60483870968)
示例#2
0
    def testOddsRatio(self):
        """Verify computation of Odds ratio effect size filter"""
        from plugins.samples.effectSizeFilters.OddsRatio import OddsRatio
        oddsRatio = OddsRatio(preferences)

        # Ground truth calculated by hand
        value = oddsRatio.run(table1[0], table1[1], table1[2], table1[3])
        self.assertAlmostEqual(value, 2.0)

        value = oddsRatio.run(table2[0], table2[1], table2[2], table2[3])
        self.assertAlmostEqual(value, 1.60483870968)
示例#3
0
	def testOddsRatio(self):
		"""Verify computation of Odds ratio CI method"""
		from plugins.samples.confidenceIntervalMethods.OddsRatio import OddsRatio
		oddsRatio = OddsRatio(preferences)
		
		# Ground truth calculated by hand
		lowerCI, upperCI, effectSize, note = oddsRatio.run(table1[0], table1[1], table1[2], table1[3], 0.95)	
		self.assertAlmostEqual(lowerCI, 0.676046021596)
		self.assertAlmostEqual(upperCI, 5.91675695474)
		self.assertAlmostEqual(effectSize, 2.0)
				 
		lowerCI, upperCI, effectSize, note = oddsRatio.run(table2[0], table2[1], table2[2], table2[3], 0.95)
		self.assertAlmostEqual(lowerCI, 1.53926774059)
		self.assertAlmostEqual(upperCI, 1.6732029238)
		self.assertAlmostEqual(effectSize, 1.60483870968)
示例#4
0
    def testOddsRatio(self):
        """Verify computation of Odds ratio CI method"""
        from plugins.samples.confidenceIntervalMethods.OddsRatio import OddsRatio
        oddsRatio = OddsRatio(preferences)

        # Ground truth calculated by hand
        lowerCI, upperCI, effectSize, note = oddsRatio.run(
            table1[0], table1[1], table1[2], table1[3], 0.95)
        self.assertAlmostEqual(lowerCI, 0.676046021596)
        self.assertAlmostEqual(upperCI, 5.91675695474)
        self.assertAlmostEqual(effectSize, 2.0)

        lowerCI, upperCI, effectSize, note = oddsRatio.run(
            table2[0], table2[1], table2[2], table2[3], 0.95)
        self.assertAlmostEqual(lowerCI, 1.53926774059)
        self.assertAlmostEqual(upperCI, 1.6732029238)
        self.assertAlmostEqual(effectSize, 1.60483870968)