[Rd] Chi-squared test p-value based on simulation.

Rolf Turner r.turner at auckland.ac.nz
Fri Dec 23 07:16:12 CET 2011


Prompted by a (fairly!) recent question from Michael Fuller, I got
to thinking about the issue of goodness-of-fit testing via chisq.test()
using p-values obtained via simulation.

I believe that such p-values are really valid only if there are no ties
in the data.  Since there are only finite number of possible samples
and hence only a finite number of statistic values, ties (while perhaps
improbable) are not impossible.  So the validity of the p-values obtained
via simulation is possibly slightly suspect.

I am given to understand that the p-values remain valid if the ties are
broken *randomly*.

Might it thereby be advisable to jitter the values of (the "true" and
simulated) test statistics before calculating the p-value?

Anyone have any thoughts on this?

     cheers,

         Rolf Turner



More information about the R-devel mailing list