# 9.5: Full Hypothesis Test Examples


## Tests on Means

Example $$\PageIndex{8}$$

Jeffrey, as an eight-year old, established a mean time of 16.43 seconds for swimming the 25-yard freestyle, with a standard deviation of 0.8 seconds. His dad, Frank, thought that Jeffrey could swim the 25-yard freestyle faster using goggles. Frank bought Jeffrey a new pair of expensive goggles and timed Jeffrey for 15 25-yard freestyle swims. For the 15 swims, Jeffrey's meantime was 16 seconds. Frank thought that the goggles helped Jeffrey to swim faster than the 16.43 seconds. Conduct a hypothesis test using a preset $$\alpha = 0.05$$.

Set up the Hypothesis Test:

Since the problem is about a mean, this is a test of a single population mean.

Set the null and alternative hypothesis:

In this case, there is an implied challenge or claim. This is that the goggles will reduce the swimming time. The effect of this is to set the hypothesis as a one-tailed test. The claim will always be in the alternative hypothesis because the burden of proof always lies with the alternative. Remember that the status quo must be defeated with a high degree of confidence, in this case, 95 % confidence. The null and alternative hypotheses are thus:

$$H_0: \mu \geq 16.43$$  $$H_a: \mu < 16.43$$

For Jeffrey to swim faster, his time will be less than 16.43 seconds. The "<" tells you this is left-tailed.

Determine the distribution needed:

Random variable: $$\overline X$$ = the meantime to swim the 25-yard freestyle.

Distribution for the test statistic:

The population standard deviation is unknown so this is a t-test, and the proper formula is: $$t_{c}=\frac{\overline{X}-\mu_{0}}{\sigma / \sqrt{n}}$$

$$\mu_ 0 = 16.43$$ comes from $$H_0$$ and not the data. $$\overline X = 16$$. $$s = 0.8$$, and $$n = 15$$.

Our step 2, setting the level of significance, has already been determined by the problem, .05 for a 95 % significance level. It is worth thinking about the meaning of this choice. The Type I error is to conclude that Jeffrey swims the 25-yard freestyle, on average, in less than 16.43 seconds when, in fact, he actually swims the 25-yard freestyle, on average, in 16.43 seconds. (Reject the null hypothesis when the null hypothesis is true.) For this case, the only concern with a Type I error would seem to be that Jeffery’s dad may fail to bet on his son’s victory because he does not have appropriate confidence in the effect of the goggles.

To find the critical value we need to select the appropriate test statistic. We have concluded that this is a t-test on the basis of the sample size and that we are interested in a population mean. We can now draw the graph of the t-distribution and mark the critical value. For this problem, the degree of freedom is n - 1, or 14. Looking up 14 degrees of freedom at the 0.05 column of the t-table we find 1.761. This is the critical value and we can put this on our graph.

Step 3 is the calculation of the test statistic using the formula we have selected. We find that the calculated test statistic is -2.08, meaning that the sample mean is 2.08 standard deviations away from the hypothesized mean of 16.43.

$t_{c}=\frac{\overline{x}-\mu_{0}}{s / \sqrt{n}}=\frac{16-16.43}{.8 / \sqrt{15}}=-2.08\nonumber$

Step 4 has us compare the test statistic and the critical value and mark these on the graph. We see that the test statistic is in the tail and thus we move to step 4 and reach a conclusion. The probability that an average time of 16 minutes could come from a distribution with a population mean of 16.43 minutes is too unlikely for us to accept the null hypothesis. We reject the null hypothesis.

Step 5 has us state our conclusions first formally and then less formally. A formal conclusion would be stated as: “With a 95% level of significance we reject the null hypothesis that the swimming time with goggles comes from a distribution with a population mean time of 16.43 minutes.” Less formally, “With 95% significance, we believe that the goggles improve swimming speed”

If we wished to use the $$p$$-value system of reaching a conclusion we would calculate the statistic and take the additional step to find the probability of being 2.08 standard deviations from the mean on a t-distribution. This value is .0187. Comparing this to the \alpha-level of .05 we see that we reject the null. The $$p$$-value has been put on the graph as the shaded area beyond -2.08 and it shows that it is smaller than the hatched area which is the alpha level of 0.05. Both methods reach the same conclusion that we reject the null hypothesis.

Exercise $$\PageIndex{8}$$

The mean throwing distance of a football for Marco, a high school freshman quarterback, is 40 yards, with a standard deviation of two yards. The team coach tells Marco to adjust his grip to get more distance. The coach records the distances for 20 throws. For the 20 throws, Marco’s mean distance was 45 yards. The coach thought the different grip helped Marco throw farther than 40 yards. Conduct a hypothesis test using a preset $$\alpha = 0.05$$. Assume the throw distances for footballs are normal.

First, determine what type of test this is, set up the hypothesis test, find the $$p$$-value, sketch the graph and state your conclusion.

Example $$\PageIndex{9}$$

Jane has just begun her new job as on the sales force of a very competitive company. In a sample of 16 sales calls it was found that she closed the contract for an average value of 108 dollars with a standard deviation of 12 dollars. Test at 5% significance that the population mean is at least 100 dollars against the alternative that it is less than 100 dollars. Company policy requires that new members of the sales force must exceed an average of $100 per contract during the trial employment period. Can we conclude that Jane has met this requirement at the significance level of 95%? Answer 1. $$H_0: \mu \leq 100$$ $$H_a: \mu > 100$$ The null and alternative hypotheses are for the parameter $$\mu$$ because the number of dollars of the contracts is a continuous random variable. Also, this is a one-tailed test because the company has only interested if the number of dollars per contact is below a particular number not "too high" a number. This can be thought of as making a claim that the requirement is being met and thus the claim is in the alternative hypothesis. 2. Test statistic: $$t_{c}=\frac{\overline{x}-\mu_{0}}{\frac{s}{\sqrt{n}}}=\frac{108-100}{\left(\frac{12}{\sqrt{16}}\right)}=2.67$$ 3. Critical value: $$t_a=1.753$$ with $$n-1$$ degrees of freedom = 15 The test statistic is a Student's t because the population standard deviation is unknown; therefore, we cannot use the normal distribution. Comparing the calculated value of the test statistic and the critical value of tt (ta)(ta) at a 5% significance level, we see that the calculated value is in the tail of the distribution. Thus, we conclude that 108 dollars per contract is significantly larger than the hypothesized value of 100 and thus we reject the null hypothesis. There is evidence that supports Jane's performance meets company standards. Exercise $$\PageIndex{9}$$ It is believed that a stock price for a particular company will grow at a rate of$5 per week with a standard deviation of $1. An investor believes the stock won’t grow as quickly. The changes in stock price is recorded for ten weeks and are as follows:$4, $3,$2, $3,$1, $7,$2, $1,$1, \$2. Perform a hypothesis test using a 5% level of significance. State the null and alternative hypotheses, state your conclusion, and identify the Type I errors.

Example $$\PageIndex{10}$$

A manufacturer of salad dressings uses machines to dispense liquid ingredients into bottles that move along a filling line. The machine that dispenses salad dressings is working properly when 8 ounces are dispensed. Suppose that the average amount dispensed in a particular sample of 35 bottles is 7.91 ounces with a variance of 0.03 ounces squared,$$s^2$$. Is there evidence that the machine should be stopped and production wait for repairs? The lost production from a shutdown is potentially so great that management feels that the level of significance in the analysis should be 99%.

Again we will follow the steps in our analysis of this problem.

STEP 1: Set the Null and Alternative Hypothesis. The random variable is the quantity of fluid placed in the bottles. This is a continuous random variable and the parameter we are interested in is the mean. Our hypothesis, therefore, is about the mean. In this case, we are concerned that the machine is not filling properly. From what we are told it does not matter if the machine is over-filling or under-filling, both seem to be an equally bad error. This tells us that this is a two-tailed test: if the machine is malfunctioning it will be shut down regardless if it is from over-filling or under-filling. The null and alternative hypotheses are thus:

$H_0:\mu=8\nonumber$

$Ha:\mu \neq 8\nonumber$

STEP 2: Decide the level of significance and draw the graph showing the critical value.

This problem has already set the level of significance at 99%. The decision seems an appropriate one and shows the thought process when setting the significance level. Management wants to be very certain, as certain as probability will allow, that they are not shutting down a machine that is not in need of repair. To draw the distribution and the critical value, we need to know which distribution to use. Because this is a continuous random variable and we are interested in the mean, and the population standard deviation is unknown, the appropriate distribution is the normal distribution, and the relevant critical value is 2.728 from the t table or the t-table at 0.005 column and infinite degrees of freedom. We draw the graph and mark these points.

STEP 3: Calculate sample parameters and the test statistic. The sample parameters are provided, the sample mean is 7.91 and the sample variance is .03 and the sample size is 35. We need to note that the sample variance was provided not the sample standard deviation, which is what we need for the formula. Remembering that the standard deviation is simply the square root of the variance, we, therefore, know the sample standard deviation, s, is 0.173. With this information, we calculate the test statistic as -3.07 and mark it on the graph.

$Z_{c}=\frac{\overline{x}-\mu_{0}}{s / \sqrt{n}}=\frac{7.91-8}{\cdot 173 / \sqrt{35}}=-3.07\nonumber$

STEP 4: Compare test statistic and critical values. Now, we compare the test statistic and the critical value by placing the test statistic on the graph. We see that the test statistic is in the tail, decidedly greater than the critical value of 2.728. We note that even the very small difference between the hypothesized value and the sample value is still a large number of standard deviations. The sample mean is only 0.08 ounces different from the required level of 8 ounces, but it is 3 plus standard deviations away and thus we reject the null hypothesis.

STEP 5: Reach a Conclusion

Three standard deviations of a test statistic will guarantee that the test will fail. The probability that anything is beyond three standard deviations is almost zero. Actually, it is 0.0026 on the t distribution, which is certainly almost zero in a practical sense. Our formal conclusion would be “ At a 99% level of significance we reject the hypothesis that the sample mean came from a distribution with a mean of 8 ounces” Or less formally, and getting to the point, “At a 99% level of significance we conclude that the machine is under filling the bottles and is in need of repair”.

## Hypothesis Test for Proportions

Just as there were confidence intervals for proportions, or more formally, the population parameter $$p$$ of the binomial distribution, there is the ability to test hypotheses concerning $$p$$.

The population parameter for the binomial is $$p$$. The estimated value (point estimate) for $$p$$ is $$p^{\prime}$$ where $$p^{\prime} = x/n$$, $$x$$ is the number of successes in the sample and $$n$$ is the sample size.

When you perform a hypothesis test of a population proportion $$p$$, you take a simple random sample from the population. The conditions for a binomial distribution must be met, which are: there are a certain number n of independent trials meaning random sampling, the outcomes of any trial are binary, success or failure, and each trial has the same probability of a success $$p$$. The shape of the binomial distribution needs to be similar to the shape of the normal distribution. To ensure this, the quantities $$np^{\prime}$$ and $$nq^{\prime}$$ must both be greater than five ($$np^{\prime} > 5$$ and $$nq^{\prime} > 5$$). In this case the binomial distribution of a sample (estimated) proportion can be approximated by the normal distribution with $$\mu=np$$ and $$\sigma=\sqrt{n p q}$$. Remember that $$q=1–p$$. There is no distribution that can correct for this small sample bias and thus if these conditions are not met we simply cannot test the hypothesis with the data available at that time. We met this condition when we first were estimating confidence intervals for $$p$$.

Again, we begin with the standardizing formula modified because this is the distribution of a binomial.

$Z=\frac{\mathrm{p}^{\prime}-p}{\sqrt{\frac{\mathrm{pq}}{n}}}\nonumber$

Substituting $$p_0$$, the hypothesized value of $$p$$, we have:

$Z_{c}=\frac{\mathrm{p}^{\prime}-p_{0}}{\sqrt{\frac{p_{0} q_{0}}{n}}}\nonumber$

This is the test statistic for testing hypothesized values of p, where the null and alternative hypotheses take one of the following forms:

Two-tailed test One-tailed test One-tailed test
$$H_0: p = p_0$$ $$H_0: p \leq p_0$$ $$H_0: p \geq p_0$$
$$H_a: p \neq p_0$$ $$H_a: p > p_0$$ $$H_a: p < p_0$$
Table $$\PageIndex{5}$$

The decision rule stated above applies here also: if the calculated value of $$Z_c$$ shows that the sample proportion is "too many" standard deviations from the hypothesized proportion, the null hypothesis cannot be accepted. The decision as to what is "too many" is pre-determined by the analyst depending on the level of significance required in the test.

Example $$\PageIndex{11}$$

The mortgage department of a large bank is interested in the nature of loans of first-time borrowers. This information will be used to tailor their marketing strategy. They believe that 50% of first-time borrowers take out smaller loans than other borrowers. They perform a hypothesis test to determine if the percentage is the same or different from 50%. The sample 100 first-time borrowers and find 53 of these loans are smaller that the other borrowers. For the hypothesis test, they choose a 5% level of significance.

STEP 1: Set the null and alternative hypotheses.

$$H_0: p = 0.50$$  $$H_a: p \neq 0.50$$

The words "is the same or different from" tell you this is a two-tailed test. The Type I and Type II errors are as follows: The Type I error is to conclude that the proportion of borrowers is different from 50% when, in fact, the proportion is actually 50%. (Reject the null hypothesis when the null hypothesis is true). The Type II error is there is not enough evidence to conclude that the proportion of first time borrowers differs from 50% when, in fact, the proportion does differ from 50%. (You fail to reject the null hypothesis when the null hypothesis is false.)

STEP 2: Decide the level of significance and draw the graph showing the critical value

The level of significance has been set by the problem at the 95% level. Because this is two-tailed test one-half of the alpha value will be in the upper tail and one-half in the lower tail as shown on the graph. The critical value for the normal distribution at the 95% level of confidence is 1.96. This can easily be found on the student’s t-table at the very bottom at infinite degrees of freedom remembering that at infinity the t-distribution is the normal distribution. Of course the value can also be found on the normal table but you have go looking for one-half of 95 (0.475) inside the body of the table and then read out to the sides and top for the number of standard deviations.

STEP 3: Calculate the sample parameters and critical value of the test statistic.

The test statistic is a normal distribution, $$Z$$, for testing proportions and is:

$Z=\frac{p^{\prime}-p_{0}}{\sqrt{\frac{p_{0} q_{0}}{n}}}=\frac{.53-.50}{\sqrt{\frac{.5(.5)}{100}}}=0.60\nonumber$

For this case, the sample of 100 found 53 first-time borrowers were different from other borrowers. The sample proportion, $$p^{\prime} = 53/100= 0.53$$ The test question, therefore, is : “Is 0.53 significantly different from .50?” Putting these values into the formula for the test statistic we find that 0.53 is only 0.60 standard deviations away from .50. This is barely off of the mean of the standard normal distribution of zero. There is virtually no difference from the sample proportion and the hypothesized proportion in terms of standard deviations.

STEP 4: Compare the test statistic and the critical value.

The calculated value is well within the critical values of $$\pm 1.96$$ standard deviations and thus we cannot reject the null hypothesis. To reject the null hypothesis we need significant evident of difference between the hypothesized value and the sample value. In this case the sample value is very nearly the same as the hypothesized value measured in terms of standard deviations.

STEP 5: Reach a conclusion

The formal conclusion would be “At a 95% level of significance we cannot reject the null hypothesis that 50% of first-time borrowers have the same size loans as other borrowers”. Less formally we would say that “There is no evidence that one-half of first-time borrowers are significantly different in loan size from other borrowers”. Notice the length to which the conclusion goes to include all of the conditions that are attached to the conclusion. Statisticians for all the criticism they receive, are careful to be very specific even when this seems trivial. Statisticians cannot say more than they know and the data constrain the conclusion to be within the metes and bounds of the data.

Exercise $$\PageIndex{11}$$

A teacher believes that 85% of students in the class will want to go on a field trip to the local zoo. She performs a hypothesis test to determine if the percentage is the same or different from 85%. The teacher samples 50 students and 39 replies that they would want to go to the zoo. For the hypothesis test, use a 1% level of significance.

Example $$\PageIndex{12}$$

Suppose a consumer group suspects that the proportion of households that have three or more cell phones is 30%. A cell phone company has reason to believe that the proportion is not 30%. Before they start a big advertising campaign, they conduct a hypothesis test. Their marketing people survey 150 households with the result that 43 of the households have three or more cell phones.

Here is an abbreviate version of the system to solve hypothesis tests applied to a test on a proportions.

$H_0 : p = 0.3 \nonumber$

$H_a : p \neq 0.3 \nonumber$

$n = 150\nonumber$

$\mathrm{p}^{\prime}=\frac{x}{n}=\frac{43}{150}=0.287\nonumber$

$Z_{c}=\frac{\mathrm{p}^{\prime}-p_{0}}{\sqrt{\frac{p_{0} q_{0}}{n}}}=\frac{0.287-0.3}{\sqrt{\frac{3(7)}{150}}}=0.347\nonumber$

Example $$\PageIndex{13}$$

The National Institute of Standards and Technology provides exact data on conductivity properties of materials. Following are conductivity measurements for 11 randomly selected pieces of a particular type of glass.

1.11; 1.07; 1.11; 1.07; 1.12; 1.08; .98; .98 1.02; .95; .95
Is there convincing evidence that the average conductivity of this type of glass is greater than one? Use a significance level of 0.05.

State the Question: We need to determine if, at a 0.05 significance level, the average conductivity of the selected glass is greater than one. Our hypotheses will be

1. $$H_0: \mu \leq 1$$
2. $$H_a: \mu > 1$$
Plan: We are testing a sample mean without a known population standard deviation with less than 30 observations. Therefore, we need to use a Student's-t distribution. Assume the underlying population is normal. Do the calculations and draw the graph. State the Conclusions: We reject the null hypothesis. It is reasonable to state that the data supports the claim that the average conductivity level is greater than one.

Example $$\PageIndex{14}$$

In a study of 420,019 cell phone users, 172 of the subjects developed brain cancer. Test the claim that cell phone users developed brain cancer at a greater rate than that for non-cell phone users (the rate of brain cancer for non-cell phone users is 0.0340%). Since this is a critical issue, use a 0.005 significance level. Explain why the significance level should be so low in terms of a Type I error.

1. $$H_0: p \leq 0.00034$$
2. $$H_a: p > 0.00034$$
2. We will be testing a sample proportion with $$x = 172$$ and $$n = 420,019$$. The sample is sufficiently large because we have $$np^{\prime} = 420,019(0.00034) = 142.8$$, $$n q^{\prime}=420,019(0.99966)=419,876.2$$, two independent outcomes, and a fixed probability of success $$p^{\prime} = 0.00034$$. Thus we will be able to generalize our results to the population.