Question :
A student bought 8 packets of crisps to eat and decided to weigh each packet. They discovered that 5 of them weighed less than the "average contents 25g" stated on the packet.
Is this significant at the 5% level?
Comment on the suitability of the test.
working
Assume that $P(x < \text{average}) = P(x > \text{average})$ for a packet.
This gives $p = 0.5$ , and $\hat{p} = \frac{5}{8} = 0.625$.
$\sigma = \sqrt{0.5 \times 0.5} = 0.5$
Standard error, $SE = \frac{\sigma}{\sqrt{n}} = \frac{0.5}{\sqrt{8}} \approx 0.177$
Using the above I have
$z = \frac{\frac{5}{8} - \frac{1}{2}}{0.177} = \frac{\frac{1}{8}}{0.177} = 0.706 \approx 0.71$.
Looking up this value in the table gives
$z = 0.2389$
Which is not less than $0.05$, so we don't reject $H_0$ in this case (at a $5\%$ significance level)
The suitability of the test is questionable as the sample size is quite low. It's also not very clear what's meant by 'average' here.
binomial model
Using a binomial model instead of a $z$-test
I assume that $p = 0.5$, then I have $X \sim Bin(8, 0.5)$
To find whether the value of $\frac{5}{8}$ packets being underweight is significant (to a $95\%$ level) I use the model as
$$ P(X) = {n \choose x }p^x (1 - p)^{n - x} $$
As
$$ P(5) = {8 \choose 5}(0.5)^{5} (0.5)^{3} $$
Which gives $\frac{7}{32} = 0.21875$.
This is insignificant at a $5\%$ level.
The binomial test was more suitable for this situation as the values were low and easy to compute.
improvements
if the student had recorded the actual weight rather than just whether or not they were less than the given average then they would have been able to make inferences based on that data.
(1)
it's very weak evidence against the hypothesis, as it's only 'off by one' (where 1 is 1/1000).(2)
my calculation is $P(X) = {1000 \choose x} p^{x}(1 - p)^{1000 - x}$ where $x = 501$, which gives roughly $0.0252$. Which isn't less than $0.025$ and isn't therefore evidence against the hypothesis. However, I think I see an error, as changing the values to10,000
and5001
I have a value which is0.0079...
, but clearly this is less significant than that of the previous example (with 1000 and 501), so I'm interpreting the output wrong... $\endgroup$