Abstract
In this article, we use a characterization of the set of sample counts that do not match with the null hypothesis of the test of goodness of fit. Two direct applications arise: first, to instantaneously generate data sets whose corresponding asymptotic P-values belong to a certain pre-defined range; and second, to compute exact P-values for this test in an efficient way. We present both issues before illustrating them by analyzing a couple of data sets. Method's efficiency is also assessed by means of simulations. We focus on Pearson's X 2 statistic but the case of likelihood-ratio statistic is also discussed.
Acknowledgment
The author wishes to thank a referee whose accurate advice helped in improving the quality of this article.