Exemplo n.º 1
0
 def test_basic(self):
     reg1 = results_factory(['x1', 'x2'], [3.14159, 1.59], [1.41343, 2.02],
                            [0.035, 0.123])
     reg2 = results_factory(['x1', 'x2'], [3.1111, 1.39], [1.4134, 2.02],
                            [0.005, 0.123])
     table_str = outreg((reg1, reg2), ['x1'], ['Coeff 1'], digits=3)
     expected = ("Coeff 1  & 3.142**    & 3.111***    \\\\ \n"
                 "         & (1.413)    & (1.413)     \\\\ \n")
     assert table_str == expected
Exemplo n.º 2
0
 def test_no_vars(self):
     reg1 = results_factory(['x1', 'x2'], [3.14159, 1.59], [1.41343, 2.02],
                            [0.035, 0.123])
     reg2 = results_factory(['x1', 'x2'], [3.1111, 1.39], [1.4134, 4.024],
                            [0.005, 0.123])
     table_str = outreg((reg1, reg2), digits=3)
     expected = ("x1  & 3.142**    & 3.111***    \\\\ \n"
                 "    & (1.413)    & (1.413)     \\\\ \n"
                 "x2  & 1.590      & 1.390       \\\\ \n"
                 "    & (2.020)    & (4.024)     \\\\ \n")
     assert table_str == expected
Exemplo n.º 3
0
 def test_3vars_1offset(self):
     reg1 = results_factory(['x1', 'x2'], [3.14159, 1.59], [1.41343, 2.02],
                            [0.035, 0.123])
     reg2 = results_factory(['x1', 'x3'], [3.1111, 1.39], [1.4134, 4.024],
                            [0.005, 0.123])
     table_str = outreg((reg1, reg2), ['x1', 'x2', 'x3'],
                        ['Coeff 1', 'Coeff 2', 'Coeff 3'],
                        digits=3)
     expected = ("Coeff 1  & 3.142**    & 3.111***    \\\\ \n"
                 "         & (1.413)    & (1.413)     \\\\ \n"
                 "Coeff 2  & 1.590      &             \\\\ \n"
                 "         & (2.020)    &             \\\\ \n"
                 "Coeff 3  &            & 1.390       \\\\ \n"
                 "         &            & (4.024)     \\\\ \n")
     assert table_str == expected
Exemplo n.º 4
0
 def test_basic(self):
     reg1 = results_factory(['x1', 'x2'],
                            [3.14159, 1.59],
                            [1.41343, 2.02],
                            [0.035, 0.123])
     reg2 = results_factory(['x1', 'x2'],
                            [3.1111, 1.39],
                            [1.4134, 2.02],
                            [0.005, 0.123])
     table_str = outreg((reg1, reg2),
                        ['x1'], ['Coeff 1'], digits=3)
     expected = (
         "Coeff 1  & 3.142**    & 3.111***    \\\\ \n"
         "         & (1.413)    & (1.413)     \\\\ \n"
     )
     assert table_str == expected
Exemplo n.º 5
0
 def test_no_vars(self):
     reg1 = results_factory(['x1', 'x2'],
                            [3.14159, 1.59],
                            [1.41343, 2.02],
                            [0.035, 0.123])
     reg2 = results_factory(['x1', 'x2'],
                            [3.1111, 1.39],
                            [1.4134, 4.024],
                            [0.005, 0.123])
     table_str = outreg((reg1, reg2), digits=3)
     expected = (
         "x1  & 3.142**    & 3.111***    \\\\ \n"
         "    & (1.413)    & (1.413)     \\\\ \n"
         "x2  & 1.590      & 1.390       \\\\ \n"
         "    & (2.020)    & (4.024)     \\\\ \n"
     )
     assert table_str == expected
Exemplo n.º 6
0
 def test_3vars_1offset(self):
     reg1 = results_factory(['x1', 'x2'],
                            [3.14159, 1.59],
                            [1.41343, 2.02],
                            [0.035, 0.123])
     reg2 = results_factory(['x1', 'x3'],
                            [3.1111, 1.39],
                            [1.4134, 4.024],
                            [0.005, 0.123])
     table_str = outreg((reg1, reg2),
                        ['x1', 'x2', 'x3'],
                        ['Coeff 1', 'Coeff 2', 'Coeff 3'],
                        digits=3)
     expected = (
         "Coeff 1  & 3.142**    & 3.111***    \\\\ \n"
         "         & (1.413)    & (1.413)     \\\\ \n"
         "Coeff 2  & 1.590      &             \\\\ \n"
         "         & (2.020)    &             \\\\ \n"
         "Coeff 3  &            & 1.390       \\\\ \n"
         "         &            & (4.024)     \\\\ \n"
     )
     assert table_str == expected