I am simulating two fair coins and running a prop.test, how come increasing number of trials doesn't decrease false positive? I'm suspecting it's in some underlying assumptions in the R functions that I'm using which I missed.
This binomial coin flip simulator takes argument N, for number of trials, and returns the p-value of an two-sided prop.test.
test.flips <- function(N, A.prop=0.5, B.prop=0.5) {
heads.A <- rbinom(1, N, A.prop)
heads.B <- rbinom(1, N, B.prop)
test <- prop.test(c(heads.A, heads.B), n=c(N, N), alternative="two.sided")
return(test$p.value)
}
I do 100 times of 1000 trials each to get this set of p-values, i.e. p.values <- replicate(100, test.flips(1000))

The red horizontal line denotes a 0.05 p-value. Notice that we have a few false positives.
Thus I do a power calculation, power <- power.prop.test(p1=0.5, p2=0.501, power=0.90, alternative="two.sided") to find that N = 5253704 if power=0.90.
So I do this again, p.values <- replicate(100, test.flips(round(power$n))) with N set to that high number of trials.
But the number of false positives didn't improve as shown here:

If all else remains equal (same sig. level), how come I'm not seeing what's gained by increasing sample size? What's wrong and how do I fix this please?
Edit:
- state clearer question in end
- As requested, here's
prop.test()$statisticversus sample size.



conf.levelargument toprop.testif you want to change the nominal false positive rate (whose default is 95%). – whuber♦ Jan 10 at 15:29