Hypothesis testing for a population proportion I’m learning Hypothesis testing for the population proportion and I have a problem. For example, in one YouTube video it said:
$H_0: p=0.3,$
$H_1: p>0.3.$
With $n=10.$
Significance level 1%.
Number of success $X=8.$
And then it just told the result, not the process, of calculating the p. It says: $P(X>=8)=0.0016.$
And here is how I did it:
Mean = $np=3.$
Standard error = $\sqrt{n(0.3)(0.7)}=1.44.$
$Z=(8-3)/1.44=3.47.$
And then I put the z on the table and it gives me the probability of 0.0002602 which is different from the result shown on the video.
Where am I doing wrong?
 A: Under $H_0: p=.3,$ the number $X$ of Successes in ten trials has $X \sim \mathsf{Binom}(n=10, p=.3).$ Then $P(X \ge 8) = 1 - P(X \le 7) = 0.0016.$
In R:
1 - pbinom(7, 10, .3)
[1] 0.001590386

This is an exact computation. I'm not sure I'd want to use a normal approximation for $n$ as small as $10$ and $p$ so far from $1/2.$ But here's how I would do it (starting with a continuity correction).
$$P(X \ge 8) = P(X > 7.5) = P\left(\frac{X-\mu}{\sigma} > \frac{7.5 -3}{1.45} = 3.10\right)\\ \approx P(Z > 3.10) =  0.00096.$$
Because we're looking at very small probabilities in the far tail
and because the normal approximation to this binomial distribution
is marginal, I'm not surprised to see a variety of P-values
in the neighborhood of $0.001$---all of them plenty small to reject $H_0$
at the 1% level.
[I didn't check the arithmetic in your answer, a normal approximation without a continuity correction. But it seems reasonable. Check
your arithmetic and use of the table once more, but my guess is
you did nothing "wrong." There are several choices of method. However, the best answer is the exact binomial one.]
x = 0:10;  pdf=dbinom(x,10,.3)
 plot(x, pdf, type="h", lwd=2, col="blue")
 abline(h=0, col="green2")
 abline(v = 7.5, col="red", lty="dotted")
 curve(dnorm(x, 3, 1.45), add=T)


