Dear R-help,
I must be missing something very obvious, but I am confused as to why
the null distribution for p values generated by binom.test() appears to
be non-uniform. The histogram generated below has a trend towards
values closer to 1 than 0. I expected it to be flat.
hist(sapply(1:1000, function(i,n=100)
binom.test(sum(rnorm(n)>0),n,p=0.5,alternative="two")$p.value))
This trend is more pronounced for small n, and the distribution appears
uniform for larger n, say n=1000. I had expected the distribution to be
discrete for small n, but not skewed. Can anyone explain why?
Many thanks,
Chris.
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.