[R] p-values for the dip test

Martin Maechler maechler at stat.math.ethz.ch
Fri Oct 22 09:23:10 CEST 2004

Hmm, this is rather about reading the (Hartigan)^2 paper ...

>>>>> "Kylie" == Kylie Lange <kylie.lange at flinders.edu.au>
>>>>>     on Fri, 22 Oct 2004 11:17:34 +0930 writes:

    Kylie> Hi all,

    Kylie> I am using Hartigan & Hartigan's [1] "dip test" of
    Kylie> unimodality via the diptest package in R. The
    Kylie> function dip() returns the value of the test
    Kylie> statistic but I am having problems calculating the
    Kylie> p-value associated with that value. I'm hoping
    Kylie> someone here is familiar with this process and can
    Kylie> explain it.

    Kylie> In the original article there is an example using
    Kylie> n=63 and a dip value of 0.059 - which I am able to
    Kylie> replicate using dip(). However the article then
    Kylie> states:

    Kylie> "The dip illustrated in Figure 1 is 0.059 which has a
    Kylie> tail probability about 10% from Table 1. (
    Kylie> sqrt(63)*D*F(63) is distributed approximately as
    Kylie> sqrt(100)*D*F(100) which has 90% point 0.474. Thus
    Kylie> D*F(63) has 90% point 0.060. )"

note:  sqrt(100) * D(F_100) =  10 * D(F_100)

       i.e. D(F_100) would have 90* point 0.0474

but the second "4" is a simple typo, (not the only one in the
paper, IIRC!);  "s/4/1/" --> you get the correct 0.0471

    Kylie> It is the value of 0.474 that I am unable to
    Kylie> get. Table 1 is a table of percentage points for
    Kylie> various sample sizes. The same table is provided in
    Kylie> the diptest package as 'qDiptab' (but at greater
    Kylie> accuracy). n=63 is not tabled but n=50 and 100
    Kylie> are. In the table for n=100 the value given for 90%
    Kylie> is 0.0471 so where does the 0.474 come from?

(see above).

    Kylie> Any help appreciated!  

you're welcome.
Martin Maechler, ETH Zurich ('diptest' maintainer)

    Kylie> [1] Hartigan JA & Hartigan PM. "The Dip Test of
    Kylie> Unimodality", The Annals of Statistics, v13(1):70-84, 1985.

More information about the R-help mailing list