Exemple #1
0
 def test_proportion(self):
     test_data = CsvReader("/Tests/Data/randomdata.csv")
     answers = CsvReader("Tests/Data/answers.csv").data
     values = Data(test_data, 'value')
     for column in answers:
         self.assertEqual(self.statistics.proportion(values),
                          float((column['proportion'])))
Exemple #2
0
 def test_confidence_interval_calculator(self):
     test_data = CsvReader("/Tests/Data/randomdata.csv")
     answers = CsvReader('Tests/Data/answers.csv').data
     values = Data(test_data, 'value')
     for column in answers:
         self.assertEqual(self.statistics.conf_interval(values), (float(
             column['conf_int_high']), float(column['conf_int_low'])))
Exemple #3
0
 def test_z_score(self):
     test_data = CsvReader("/Tests/Data/randomdata.csv")
     answers = CsvReader("Tests/Data/answers.csv").data
     values = Data(test_data, "value")
     for column in answers:
         self.assertEqual(self.statistics.z_score(values),
                          float((column['zscore'])))
Exemple #4
0
 def test_pop_std_dev(self):
     test_data = CsvReader("/Tests/Data/randomdata.csv")
     answers = CsvReader("Tests/Data/answers.csv").data
     values = Data(test_data, 'value')
     for column in answers:
         self.assertEqual(
             round(self.statistics.pop_standard_dev(values), 4),
             float((column['PSD'])))
Exemple #5
0
 def test_sample_variance(self):
     test_data = CsvReader("/Tests/Data/randomdata.csv")
     answers = CsvReader("Tests/Data/answers.csv").data
     values = Data(test_data, 'value')
     x = self.statistics.sample_variance(values)
     self.assertEqual(x, x)