def testRatioProportionsGroup(self): """Verify computation of ratio of proportions group effect size filter""" from plugins.groups.effectSizeFilters.RatioProportions import RatioProportions ratioProportions = RatioProportions(preferences) # Ground truth calculated by hand value = ratioProportions.run([1,2,3,4,5], [2,4,5,8,10]) self.assertAlmostEqual(value, (15.0/5) / (29.0/5)) value = ratioProportions.run([1],[1,1]) self.assertAlmostEqual(value, (1.0/1) / (2.0/2))
def testRatioProportions(self): """Verify computation of ratio of proportions effect size filter""" from plugins.samples.effectSizeFilters.RatioProportions import RatioProportions ratioProportions = RatioProportions(preferences) # Ground truth calculated by hand value = ratioProportions.run(table1[0], table1[1], table1[2], table1[3]) self.assertAlmostEqual(value, 1.66666666666666) value = ratioProportions.run(table2[0], table2[1], table2[2], table2[3]) self.assertAlmostEqual(value, 1.6)
def testRatioProportionsGroup(self): """Verify computation of ratio of proportions group effect size filter""" from plugins.groups.effectSizeFilters.RatioProportions import RatioProportions ratioProportions = RatioProportions(preferences) # Ground truth calculated by hand value = ratioProportions.run([1, 2, 3, 4, 5], [2, 4, 5, 8, 10]) self.assertAlmostEqual(value, (15.0 / 5) / (29.0 / 5)) value = ratioProportions.run([1], [1, 1]) self.assertAlmostEqual(value, (1.0 / 1) / (2.0 / 2))
def testRatioProportions(self): """Verify computation of Ratio of proportions CI method""" from plugins.samples.confidenceIntervalMethods.RatioProportions import RatioProportions ratioProportions = RatioProportions(preferences) # Ground truth calculated by hand lowerCI, upperCI, effectSize, note = ratioProportions.run(table1[0], table1[1], table1[2], table1[3], 0.95) self.assertAlmostEqual(lowerCI, 0.748767825898) self.assertAlmostEqual(upperCI, 3.70979852726) self.assertAlmostEqual(effectSize, 1.66666666666666) lowerCI, upperCI, effectSize, note = ratioProportions.run(table2[0], table2[1], table2[2], table2[3], 0.95) self.assertAlmostEqual(lowerCI, 1.53505365781) self.assertAlmostEqual(upperCI, 1.6676941467) self.assertAlmostEqual(effectSize, 1.6)
def testRatioProportions(self): """Verify computation of Ratio of proportions CI method""" from plugins.samples.confidenceIntervalMethods.RatioProportions import RatioProportions ratioProportions = RatioProportions(preferences) # Ground truth calculated by hand lowerCI, upperCI, effectSize, note = ratioProportions.run( table1[0], table1[1], table1[2], table1[3], 0.95) self.assertAlmostEqual(lowerCI, 0.748767825898) self.assertAlmostEqual(upperCI, 3.70979852726) self.assertAlmostEqual(effectSize, 1.66666666666666) lowerCI, upperCI, effectSize, note = ratioProportions.run( table2[0], table2[1], table2[2], table2[3], 0.95) self.assertAlmostEqual(lowerCI, 1.53505365781) self.assertAlmostEqual(upperCI, 1.6676941467) self.assertAlmostEqual(effectSize, 1.6)