Beispiel #1
0
 def test_paired_t_value(self):
     """
     See documentation from here:
     http://en.wikipedia.org/wiki/Student's_t-test
     for the t-values
     """
     d_sdevs = 1 ** 2 * np.sqrt(self.n1 / float(self.n1 - 1))
     paired_t_val_should_be = -2 / (d_sdevs / np.sqrt(self.n1))
     computed_paired_t_val = measures.paired_t_value(
         self.one_dim_data_paired, self.n1)
     assert_almost_equal(paired_t_val_should_be, computed_paired_t_val)
Beispiel #2
0
    def setUp(self):
        self.as_arr_alm_eq = np.testing.assert_almost_equal
        self.simple_data_n1 = 3
        self.simple_data_n2 = 3
        self.simple_data = np.array([-2, 1, 2, 2, 3, 6])
        # multiply by two as we report two-sided p-values
        self.simple_data_p_paired = 1.0 / 2 ** 3 * 2

        self.simple_data_p_unpaired = 2.0 / (6 * 5 * 4 / (3 * 2 * 1)) * 2
        # 2 (number of combinations for such a low value for md or t-value)
        # /(6*5*4/(3*2*1)) tot number of combinations
        # *2 two-sided p-value

        self.simple_data_meandiff = -10 / 3.0
        self.simple_data_t_value_paired = measures.paired_t_value(self.simple_data, self.simple_data_n1)
        self.simple_data_t_value_unpaired = measures.unpaired_t_value(self.simple_data, self.simple_data_n1)