# Statistics: what kind of test to use to test this hypothesis?

I am unsure what kind of a hypothesis test to use in my case:

So we are filling 500 ml bottles with water;

It's a known fact that before a max of 3% of all the bottles could be under-filled;

Now I took a sample of 180 bottles and 8 of them were under-filled.

With a significance level of 0.05, can we say that the percentage has changed?

Hypothesis: percentage has changed

• Test whether the observation "of 180 bottles and 8 of them were under-filled" should be considered extreme if the hypothesis that "a max of 3% of all the bottles could be under-filled" is correct – Henry May 25 '19 at 0:15
• Let $U =$ Nr Underfilled out of $n = 180$ and P(Underfilled) = $p.$ Test $H_0: p \le .03$ vs $H_a: p > .03.$ Null dist'n $Binom(180, .03).$ Observe $8/180 =0.044 > 0.03$ underfilled. Is this enough larger than 0.03 to reject $H_0?$ P-value $= P(U \ge 8) = 1 - P(U \le 7| p > .03),$ In R 1 - pbinom(7, 180, .03) returns $0.1754 > 0.05),$ so not signif at 5% level. This is an exact binomial test. [Some guidelines for normal aprx to binomial would allow using normal aprx to get aprx P-val. Normal aprx with continuity correction also gives P-val about 0.18.] – BruceET May 25 '19 at 0:58
• @BruceET your comment is much more than what I could've hoped for, I would like to mark it as answer but can't cause it's just a comment. If you care to, you can submit it as an answer and I will mark it as such. Also, thanks so much for your help and I hope you have a great d̶a̶y̶ m̶o̶n̶t̶h̶ year! – curiousMinded May 25 '19 at 22:14
• Thanks. Happy the Comment helped. I have already gotten up-votes for somewhat similar answers. (But not so similar that I could be sure showing a link would help you.) So I'll let it stay as a comment. – BruceET May 25 '19 at 22:51

Let $$U =$$ Nr Underfilled out of $$n=180$$ and P(Underfilled) = $$p.$$ Test $$H$$0 $$:p≤.03$$ vs $$H$$a $$:p>.03.$$ Null dist'n $$Binom(180,.03).$$ Observe $$8/180=0.044>0.03$$ underfilled. Is this enough larger than 0.03 to reject $$H$$0$$?$$ P-value $$=P(U≥8)=1−P(U≤7|p>.03),$$ In R 1 - pbinom(7, 180, .03) returns $$0.1754>0.05),$$ so not signif at 5% level. This is an exact binomial test. [Some guidelines for normal aprx to binomial would allow using normal aprx to get aprx P-val. Normal aprx with continuity correction also gives P-val about 0.18.]