Exemplo n.º 1
0
    def test_bonf(self):
        """Test function bonf
        Compare to the p.adjust R function.
        """
        reject, pval_corr = bonf(pvals)
        assert_array_equal(reject, [False, False, True, False, False])
        assert_array_almost_equal(pval_corr, [1, 0.6, 0.0005, 0.15, 0.7])

        # With NaN values
        _, pval_corr = bonf(pvals2_NA)
        assert_array_almost_equal(pval_corr, [1, np.nan, 0.4, 1., 0.56])

        # With 2D arrays
        _, pval_corr = bonf(pvals_2d)
        pval_corr = np.round(pval_corr.ravel(), 3)
        assert_array_almost_equal(pval_corr, [1, 1, 0.001, 0.27, 1, 1, np.nan,
                                              .9, 1., 1.])
Exemplo n.º 2
0
 def test_bonf(self):
     """Test function bonf"""
     bonf(pvals)
     bonf(pvals, alpha=.01)
     bonf(pvals, alpha=.90)