def testDiffBetweenPropGroup(self): """Verify computation of Difference between proportions group effect size filter""" from plugins.groups.effectSizeFilters.DiffBetweenProp import DiffBetweenProp diffBetweenProp = DiffBetweenProp(preferences) # Ground truth calculated by hand value = diffBetweenProp.run([1,2,3,4,5], [2,4,5,8,10]) self.assertAlmostEqual(value, 15.0/5 - 29.0/5) value = diffBetweenProp.run([1],[1,1]) self.assertAlmostEqual(value, 1.0/1 - 2.0/2)
def testDiffBetweenProp(self): """Verify computation of Difference between proportions effect size filter""" from plugins.samples.effectSizeFilters.DiffBetweenProp import DiffBetweenProp diffBetweenProp = DiffBetweenProp(preferences) # Ground truth calculated by hand value = diffBetweenProp.run(table1[0], table1[1], table1[2], table1[3]) self.assertAlmostEqual(value, 13.333333333) value = diffBetweenProp.run(table2[0], table2[1], table2[2], table2[3]) self.assertAlmostEqual(value, 0.3)
def testDiffBetweenPropGroup(self): """Verify computation of Difference between proportions group effect size filter""" from plugins.groups.effectSizeFilters.DiffBetweenProp import DiffBetweenProp diffBetweenProp = DiffBetweenProp(preferences) # Ground truth calculated by hand value = diffBetweenProp.run([1, 2, 3, 4, 5], [2, 4, 5, 8, 10]) self.assertAlmostEqual(value, 15.0 / 5 - 29.0 / 5) value = diffBetweenProp.run([1], [1, 1]) self.assertAlmostEqual(value, 1.0 / 1 - 2.0 / 2)
def testDiffBetweenProp(self): """Verify computation of Difference between proportions test""" from plugins.samples.statisticalTests.DiffBetweenProp import DiffBetweenProp diffBetweenProp = DiffBetweenProp(preferences) # Ground truth obtained from R version 2.10 oneSided, twoSided, note = diffBetweenProp.hypothesisTest(table1[0], table1[1], table1[2], table1[3]) self.assertAlmostEqual(oneSided, 0.103275200626) self.assertAlmostEqual(twoSided, 0.206550401252) oneSided, twoSided, note = diffBetweenProp.hypothesisTest(table2[0], table2[1], table2[2], table2[3]) self.assertAlmostEqual(oneSided, 2.220446049e-16) self.assertAlmostEqual(twoSided, 2.220446049e-16)
def testDiffBetweenProp(self): """Verify computation of Difference between proportions test""" from plugins.samples.statisticalTests.DiffBetweenProp import DiffBetweenProp diffBetweenProp = DiffBetweenProp(preferences) # Ground truth obtained from R version 2.10 oneSided, twoSided, note = diffBetweenProp.hypothesisTest( table1[0], table1[1], table1[2], table1[3]) self.assertAlmostEqual(oneSided, 0.103275200626) self.assertAlmostEqual(twoSided, 0.206550401252) oneSided, twoSided, note = diffBetweenProp.hypothesisTest( table2[0], table2[1], table2[2], table2[3]) self.assertAlmostEqual(oneSided, 2.220446049e-16) self.assertAlmostEqual(twoSided, 2.220446049e-16)