[Rd] Small bug in fligner.test - constant values can produce significant results (patch attached)

Karolis Koncevičius k@ro||@@koncev|c|u@ @end|ng |rom gm@||@com
Tue Jun 18 23:37:57 CEST 2019

In specific cases fligner.test() can produce a small p-value even when both groups have constant variance.

Here is an illustration:

    fligner.test(c(1,1,2,2), c("a","a","b","b"))
    # p-value = NA


    fligner.test(c(1,1,1,2,2,2), c("a","a","a","b","b","b"))
    # p-value < 2.2e-16

This can potentially get dangerous if people perform lots of parallel tests of this type (i.e. when doing a test for each gene in genomic studies).

Submitted a proposed patch that should solve the issue by producing an error "data is essentially constant"
- which is the same error message found in t-test under similar conditions.

P.S. First time writing to this list. Read all the guides of posting, but sorry in advance if I still missed any rules.

Karolis Koncevičius

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch.diff
URL: <https://stat.ethz.ch/pipermail/r-devel/attachments/20190619/0642547d/attachment.ksh>

More information about the R-devel mailing list