示例#1
0
 def testLookupPValue_LargeDegreesOfFreedom_LastRowIsUsed(self):
   # The last row of the table should be used.
   self.assertEqual(0.02, ttest._LookupPValue(2.365, 100.0))
示例#2
0
 def testLookupPValue_ZeroTValue_FirstColumnIsUsed(self):
   # The largest possible p-value will be used when t is zero.
   self.assertEqual(1.0, ttest._LookupPValue(0.0, 1.0))
   self.assertEqual(1.0, ttest._LookupPValue(0.0, 2.0))
示例#3
0
 def testLookupPValue_SmallTValue_FirstColumnIsUsed(self):
   # The largest possible p-value will be used when t is almost zero.
   self.assertEqual(1.0, ttest._LookupPValue(0.1, 2.0))
   self.assertEqual(1.0, ttest._LookupPValue(-0.1, 2.0))
示例#4
0
 def testLookup_DFAndTValueBetweenTwoValues_SmallerRowAndColumnIsUsed(self):
   self.assertEqual(0.1, ttest._LookupPValue(2.0, 45.0))
   self.assertEqual(0.1, ttest._LookupPValue(-2.0, 45.0))
示例#5
0
 def testLookupPValue_LargeTValue_LastColumnIsUsed(self):
   # The smallest possible p-value will be used when t is large.
   self.assertEqual(0.01, ttest._LookupPValue(500.0, 1.0))
   self.assertEqual(0.01, ttest._LookupPValue(-500.0, 1.0))
示例#6
0
 def testLookupPValue_TValueBetweenTwoValues_SmallerColumnIsUsed(self):
   # The second column is used because 3.1 is below 4.303,
   # so the next-lowest t-value, 2.920, is used.
   self.assertEqual(0.2, ttest._LookupPValue(3.1, 2.0))
   self.assertEqual(0.2, ttest._LookupPValue(-3.1, 2.0))
示例#7
0
 def testLookup_DFBetweenTwoValues_SmallerRowIsUsed(self):
   self.assertEqual(0.05, ttest._LookupPValue(2.228, 45.0))
   self.assertEqual(0.05, ttest._LookupPValue(-2.228, 45.0))
示例#8
0
 def testLookupPValue_LargeDegreesOfFreedom_LastRowIsUsed(self):
     # The last row of the table should be used.
     self.assertEqual(0.02, ttest._LookupPValue(2.365, 100.0))
示例#9
0
 def testLookupPValue_ExactMatchInTable(self):
   """Tests looking up an entry that is in the table."""
   self.assertEqual(0.1, ttest._LookupPValue(3.182, 3.0))
   self.assertEqual(0.1, ttest._LookupPValue(-3.182, 3.0))
示例#10
0
 def testLookupPValue_ZeroTValue_FirstColumnIsUsed(self):
     # The largest possible p-value will be used when t is zero.
     self.assertEqual(1.0, ttest._LookupPValue(0.0, 1.0))
     self.assertEqual(1.0, ttest._LookupPValue(0.0, 2.0))
示例#11
0
 def testLookupPValue_SmallTValue_FirstColumnIsUsed(self):
     # The largest possible p-value will be used when t is almost zero.
     self.assertEqual(1.0, ttest._LookupPValue(0.1, 2.0))
     self.assertEqual(1.0, ttest._LookupPValue(-0.1, 2.0))
示例#12
0
 def testLookupPValue_LargeTValue_LastColumnIsUsed(self):
     # The smallest possible p-value will be used when t is large.
     self.assertEqual(0.01, ttest._LookupPValue(500.0, 1.0))
     self.assertEqual(0.01, ttest._LookupPValue(-500.0, 1.0))
示例#13
0
 def testLookup_DFAndTValueBetweenTwoValues_SmallerRowAndColumnIsUsed(self):
     self.assertEqual(0.1, ttest._LookupPValue(2.0, 45.0))
     self.assertEqual(0.1, ttest._LookupPValue(-2.0, 45.0))
示例#14
0
 def testLookup_DFBetweenTwoValues_SmallerRowIsUsed(self):
     self.assertEqual(0.05, ttest._LookupPValue(2.228, 45.0))
     self.assertEqual(0.05, ttest._LookupPValue(-2.228, 45.0))
示例#15
0
 def testLookupPValue_TValueBetweenTwoValues_SmallerColumnIsUsed(self):
     # The second column is used because 3.1 is below 4.303,
     # so the next-lowest t-value, 2.920, is used.
     self.assertEqual(0.2, ttest._LookupPValue(3.1, 2.0))
     self.assertEqual(0.2, ttest._LookupPValue(-3.1, 2.0))
示例#16
0
 def testLookupPValue_ExactMatchInTable(self):
     """Tests looking up an entry that is in the table."""
     self.assertEqual(0.1, ttest._LookupPValue(3.182, 3.0))
     self.assertEqual(0.1, ttest._LookupPValue(-3.182, 3.0))