Exercise 13: Political Race (Pg. 227)
If, based on a sample size of 200, a political candidate found that 125 people would vote for her in a two person race:
N <- 200
p <- 125/200
z <- 2.576
c1 <- p - z*sqrt(p*(1-p)/N)
c2 <- p + z*sqrt(p*(1-p)/N)
cat("[",c1,", ",c2,"]")
## [ 0.5368167 , 0.7131833 ]
(.5-.625)/sqrt(p*(1-p)/N)
## [1] -3.651484
We look up a z-score of -3.65 and get an area of .9999. This is the probability that she will lose! Therefore, she would not be confident of winning based on this poll.