I'm testing if three independent experiments have the same probability of success ($H_0: p_1 = p_2 = p_3$). For $f_1 = f_2 = f_3 = 0$ and $n_1 = n_2 = n_3 = 10$ (zero successes out of 10 trials in all experiments), the R function prop.test returns a NaN for the p-value:
prop.test(c(0,0,0), c(10,10,10))$p.value
## [1] NaN
## Warning message:
## In prop.test(c(0, 0, 0), c(10, 10, 10)) :
## Chi-squared approximation may be incorrect
If I replace one of the zeros by a very small value (e.g., $10^{-100}$), the p-value is 1 as expected. The same occurs with $f_1 = f_2 = f_3 = 10$, but disappears when e.g. $f_3 = 10 - 10^{-10}$. (I'm aware that the values should be integers.)
Is this a glitch in R's implementation, or is the p-value undefined for some reason in the cases described above?
prop.testdirects you to usebinom.test. – whuber Aug 14 '15 at 15:04prop.testmore convenient for my case, because I can simultaneously plug in the results of all stochastic algorithms under test. (I have more than three algorithms, in fact.) – krlmlr Aug 14 '15 at 15:25prop.testis inapplicable in your case. That's why it issues a warning. You ought to heed it. – whuber Aug 14 '15 at 17:08Deducer::likelihood.test, unless you can suggest something more suitable. – krlmlr Aug 14 '15 at 20:02prop.testfor testing equality of proportions in an experiment with very low or very high success probability, the p-values are not uniform under $H_0$, presumably because they are now an approximation. I used 10 trials in the question to simplify the example, in reality it's $10^4$ trials. -- I think the question at hand is solved, my new question has been closed with a reference to Fisher's exact test -- but that doesn't seem to work for me either, I'm going to ask why in yet another question. – krlmlr Aug 20 '15 at 14:32