Total Complexity | 2 |
Total Lines | 24 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | import unittest |
||
9 | class AnovaUnitTest(unittest.TestCase): |
||
10 | def test_anova(self): |
||
11 | sample = Sample() |
||
12 | |||
13 | mu1 = 1.0 |
||
14 | sigma1 = 1.0 |
||
15 | |||
16 | mu2 = 1.1 |
||
17 | sigma2 = 1.0 |
||
18 | |||
19 | mu3 = 1.09 |
||
20 | sigma3 = 1.0 |
||
21 | |||
22 | for i in range(100): |
||
23 | sample.add_numeric(normal(mu1, sigma1), 'group1') |
||
24 | sample.add_numeric(normal(mu2, sigma2), 'group2') |
||
25 | sample.add_numeric(normal(mu3, sigma3), 'group3') |
||
26 | |||
27 | testing = Anova(sample=sample) |
||
28 | |||
29 | print('p-value: ' + str(testing.p_value)) |
||
30 | reject = testing.will_reject(0.01) |
||
31 | print('will reject [same mean for all groups] ? ' + str(reject)) |
||
32 | self.assertFalse(reject) |
||
33 | |||
36 |