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'])))
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'])))
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'])))
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'])))
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)