Пример #1
0
	def testDiffBetweenPropGroup(self):
		"""Verify computation of Difference between proportions group effect size filter"""
		from stamp.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)
Пример #2
0
	def testDiffBetweenProp(self):
		"""Verify computation of Difference between proportions effect size filter"""
		from stamp.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)