# How should I formulate this hypothesis test?

I have the following problem solved by my professor:

A company of high resistance painting products claims that, at the most, 1% of its containers have a weight outside specification limits. To investigate the plausibility of this assertion, a sample of n = 45 containers has been taken, which is such that only one container is defective. At the level α = 0.05, is there evidence against the manufacturer’s claim?

The way I thought I could test this is by setting: $$H_0:p=0.01$$ $$H_1:p<0.01$$, and testing this, I get that the null hypothesis is not rejected so that there is evidence against the manufacturer's claim. However, my professor solved it by testing: $$H_0:p=0.01$$ $$H_1:p>0.01$$ , and concludes that there is not enough evidence. I am really confused. How should this be approached?

Notice that the test you want to claim is that $p=0.01$ at most. So you need to formulate the null hypotheses as what the company (or whoever makes a claim, depending on the problem statement) claims, and the alternative as something that would prove them (the company) wrong.

In this case, they claim "at most" p=0.01, so the alternative, what would prove them wrong is $p>0.01$, so $p$ is more than 1%.

• Thank you for your reply. I understand what you are saying, and I will start solving my problems following your procedure. Would my interpretation be wrong then? Intuitively, both tests should reach the same conclusion right?
– Bee
Dec 10, 2017 at 22:08
• No, both tests will not reach the same conclusion. When you solve hypotheses testing problems, the statement says something like "person/entity ABC claims that object XYZ is this way". You have to think in terms of what would prove their claim to be wrong. In this case, if they say "at most 1% defects", showing that it is less than 1% ($p<0.01$) would NOT prove them wrong, it would in fact prove them even more right. The opposite of "at most 1%" is "more than 1%", this is your alternative hypothesis. Dec 10, 2017 at 22:14

If p < 0.01 that would mean that the maximum proportion of defects is even less that 1%, so the alternative hypothesis set by your professor seems right. Your alternative hypothesis doesn't really play a role if you're only concerned with Type I error, that is, the probability that you will reject a true null hypothesis, which in your case is set as 5% ($\alpha$ being 0.05).

And notice that your $H_0$ not getting rejected means that there is more that 5% chance that the data was indeed sampled from a binomial distribution with p = 0.01 (where success is defined as a defect), which I guess is how you model your null hypothesis distribution. So in fact you too should conclude that there is not enough evidence to decide whether manufacturer is telling the truth or not.

In my conservative approach to this problem, the company's claim should be set as the alternative hypothesis, not the null hypothesis. It is incumbent upon the company to prove their quality. By setting the company's claim as the null hypothesis, their claim is supported up and until enough evidence is accumulated to reject their claim. This is an approach to the problem, but effectively creates a logic that the company's quality is assumed good until proven otherwise. We usually assume a world in which claims require evidence, not one in which claims are assumed true. In addition, the hypothesis tests should cover the entire range of possible results giving:

$$H_0:p(defects) > 0.01 \\ H_a:p(defects) \leq 0.01$$

The test statistic is 1/45 (2.2%) with a standard error of 2.2%. The difference between 1% claimed and 2.2% measured is 1.2%. Standardizing, we obtain a z-score of 0.54 and a p-value of 0.71. Based on the sampled data, we cannot reject the null hypothesis that the probability of defects is >0.01 at a one-sided alpha $\le$ 0.05. Thus, I arrive at the same answer, but protect myself against accepting the company's claim as the result of insufficient data.

• This analysis is the opposite of "conservative." To see why, suppose that all 45 objects in the sample were defective. Your test statistic of $100\%$ would have an enormous Z-score and you would obtain a p-value of $1.00$, thereby not concluding that the company's claim is false--in violation of all common sense and the evidence.
– whuber
Dec 11, 2017 at 17:10
• While defective, if I'm asking a one-sided question related to the left tail, am I not still internally consistent with my setup regardless of numerous failures? Dec 11, 2017 at 17:24