Beispiel #1
0
	def testRatioProportionsGroup(self):
		"""Verify computation of ratio of proportions group effect size filter"""
		from stamp.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))
Beispiel #2
0
	def testRatioProportions(self):
		"""Verify computation of ratio of proportions effect size filter"""
		from stamp.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)
Beispiel #3
0
	def testRatioProportions(self):
		"""Verify computation of Ratio of proportions CI method"""
		from stamp.plugins.samples.confidenceIntervalMethods.RatioProportions import RatioProportions
		ratioProportions = RatioProportions(preferences)
		
		# Ground truth calculated by hand
		lowerCI, upperCI, effectSize, _ = 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, _ = 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)