Skip to content
Prev 12316 / 63461 Next

fligner.test (ctest) (PR#6739)

karel.zvara@mff.cuni.cz writes:
Right. x is not in the same order as g is after that operation, so
the two lines that come immediately after are incoherent:

    a <- qnorm((1 + rank(abs(x))/(n + 1))/2)
    STATISTIC <- sum(tapply(a, g, "sum")^2/tapply(a, g, "length"))


I think the unlist construction wants to be replaced with

  x <- x - tapply(x,g,median)[g]