def test_method_zscore(self): mean = self.row_data.columns['mean'][0] sd = self.row_data.columns['sd'][0] zscore = roundOff(self.row_data.columns['zscore'][0]) # zscore = roundOff(float(row['zscore'])) self.assertEqual(self.stats.zscore(self.stats_row[0], mean, sd), zscore) self.assertEqual(self.stats.result, zscore) self.assertNotEqual(self.stats.result, square(zscore))
def varpp(a): val = stddev(a) result = square(val) return roundOff(result)
def test_method_variance_pop_prop(self): corr = 10 result = roundOff(0.1) self.assertEqual(self.stats.varProp(self.stats_row, corr), result) self.assertNotEqual(self.stats.result, square(result))
def test_method_sample_variance(self): expected = self.stats.vpp(self.sampleData) self.assertEqual(self.stats.vpp(self.sampleData), expected) self.assertNotEqual(self.stats.vpp(self.sampleData), square(expected))
def test_method_vpp(self): vpp = roundOff(float(self.row_data.columns['vpp'][0])) self.assertEqual(self.stats.vpp(self.stats_row), vpp) self.assertEqual(self.stats.result, vpp) self.assertNotEqual(self.stats.result, square(vpp))
def test_method_sample_sd(self): expected = self.stats.sd(self.sampleData) self.assertEqual(self.stats.sd(self.sampleData), expected) self.assertNotEqual(self.stats.sd(self.sampleData), square(expected))
def test_method_mode(self): mode = roundOff(float(self.row_data.columns['mode'][0])) self.assertEqual(self.stats.mode(self.stats_row), mode) self.assertEqual(self.stats.result, mode) self.assertNotEqual(self.stats.result, square(mode))
def test_method_median(self): median = roundOff(float(self.row_data.columns['median'][0])) self.assertEqual(self.stats.median(self.stats_row), median) self.assertEqual(self.stats.result, median) self.assertNotEqual(self.stats.result, square(median))
def square(self, a): self.result = square(a) return self.result