コード例 #1
0
    def test_holm(self):
        """Test function holm.
        Compare to the p.adjust R function.
        """
        reject, pval_corr = holm(pvals)
        assert_array_equal(reject, [False, False, True, False, False])
        assert_array_equal(pval_corr, [5.2e-01, 3.6e-01, 5.0e-04,
                                       1.2e-01, 3.6e-01])
        _, pval_corr = holm(pvals2)
        assert_array_equal(pval_corr, [0.6, 0.5, 0.5, 0.6, 0.5])

        # With NaN values
        _, pval_corr = holm(pvals2_NA)
        assert_array_almost_equal(pval_corr, [0.6, np.nan, 0.4, 0.6, 0.42])

        # 2D array
        _, pval_corr = holm(pvals_2d)
        pval_corr = np.round(pval_corr.ravel(), 3)
        assert_array_almost_equal(pval_corr, [1, 0.72, 0.001, 0.24, 0.72,
                                              1., np.nan, 0.7, 0.9, 0.72])
コード例 #2
0
 def test_holm(self):
     """Test function holm"""
     holm(pvals)
     holm(pvals, alpha=.01)
     holm(pvals, alpha=.90)