Esempio n. 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))
Esempio n. 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))
Esempio n. 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))
Esempio n. 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))
Esempio n. 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))
Esempio n. 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))
Esempio n. 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))
Esempio n. 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))
Esempio n. 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))
Esempio n. 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))
Esempio n. 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))
Esempio n. 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))
Esempio n. 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))
Esempio n. 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))
Esempio n. 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))
Esempio n. 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))