# 7.4: Distribution Needed for Hypothesis Testing

- Page ID
- 51824

\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

\( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

\( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

\( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

\( \newcommand{\Span}{\mathrm{span}}\)

\( \newcommand{\id}{\mathrm{id}}\)

\( \newcommand{\Span}{\mathrm{span}}\)

\( \newcommand{\kernel}{\mathrm{null}\,}\)

\( \newcommand{\range}{\mathrm{range}\,}\)

\( \newcommand{\RealPart}{\mathrm{Re}}\)

\( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

\( \newcommand{\Argument}{\mathrm{Arg}}\)

\( \newcommand{\norm}[1]{\| #1 \|}\)

\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

\( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

\( \newcommand{\vectorA}[1]{\vec{#1}} % arrow\)

\( \newcommand{\vectorAt}[1]{\vec{\text{#1}}} % arrow\)

\( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

\( \newcommand{\vectorC}[1]{\textbf{#1}} \)

\( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

\( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

\( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

\(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)Earlier, we discussed sampling distributions. Particular distributions are associated with hypothesis testing.We will perform hypotheses tests of a population mean using a normal distribution or a Student's \(t\)-distribution. (Remember, use a Student's \(t\)-distribution when the population standard deviation is unknown and the sample size is small, where small is considered to be less than 30 observations.) We perform tests of a population proportion using a normal distribution when we can assume that the distribution is normally distributed. We consider this to be true if the sample proportion, \(p^{\prime}\), times the sample size is greater than 5 and \(1-p^{\prime}\) times the sample size is also greater then 5. This is the same rule of thumb we used when developing the formula for the confidence interval for a population proportion.

## Hypothesis Test for the Mean

Going back to the standardizing formula we can derive the **test statistic** for testing hypotheses concerning means.

\[Z_{c}=\frac{\overline{x}-\mu_{0}}{\sigma / \sqrt{n}}\nonumber\]

The standardizing formula can not be solved as it is because we do not have \(\mu\), the population mean. However, if we substitute in the hypothesized value of the mean, \(\mu_0\) in the formula as above, we can compute a \(Z\) value. This is the test statistic for a test of hypothesis for a mean and is presented in Figure 9.3. We interpret this \(Z\) value as the associated probability that a sample with a sample mean of \(\overline X\) could have come from a distribution with a population mean of \(H_0\) and we call this \(Z\) value \(Z_c\) for “calculated”. Figure 9.3 and Figure 9.4 show this process.

Figure 9.3In Figure 9.3 two of the three possible outcomes are presented. \(\overline X_1\) and \(\overline X_3\) are in the tails of the hypothesized distribution of \(H_0\). Notice that the horizontal axis in the top panel is labeled \(\overline X\)'s. This is the same theoretical distribution of \(\overline X\)'s, the sampling distribution, that the Central Limit Theorem tells us is normally distributed. This is why we can draw it with this shape. The horizontal axis of the bottom panel is labeled \(Z\) and is the standard normal distribution. \(Z_{\frac{\alpha}{2}}\) and \(-Z_{\frac{\alpha}{2}}\), called the **critical values**, are marked on the bottom panel as the \(Z\) values associated with the probability the analyst has set as the level of significance in the test, (\(\alpha\)). The probabilities in the tails of both panels are, therefore, the same.

Notice that for each \(\overline X\) there is an associated \(Z_c\), called the calculated \(Z\), that comes from solving the equation above. This calculated \(Z\) is nothing more than the number of standard deviations that the **hypothesized** mean is from the sample mean. If the sample mean falls "too many" standard deviations from the hypothesized mean we conclude that the **sample** mean could not have come from the distribution with the hypothesized mean, given our pre-set required level of significance. It **could** have come from \(H_0\), but it is deemed just too unlikely. In Figure 9.3 both \(\overline X_1\) and \(\overline X_3\) are in the tails of the distribution. They are deemed "too far" from the hypothesized value of the mean given the chosen level of alpha. If in fact this sample mean it did come from \(H_0\), but from in the tail, we have made a Type I error: we have rejected a good null. Our only real comfort is that we know the probability of making such an error, \alpha, and we can control the size of \(\alpha\).

Figure 9.4 shows the third possibility for the location of the sample mean, \(\overline x\). Here the sample mean is within the two critical values. That is, within the probability of \((1-\alpha)\) and we cannot reject the null hypothesis.

Figure 9.4This gives us the decision rule for testing a hypothesis for a two-tailed test:

Decision rule: two-tail test |
---|

If \(\left|\mathrm{Z}_{c}\right|<\mathrm{Z}_{\frac{\alpha}{2}}\) : then do not REJECT \(H_0\) |

If \(\left|\mathrm{Z}_{c}\right|>\mathrm{Z}_{\frac{\alpha}{2}}\) : then REJECT \(H_0\) |

This rule will always be the same no matter what hypothesis we are testing or what formulas we are using to make the test. The only change will be to change the \(Z_c\) to the appropriate symbol for the test statistic for the parameter being tested. Stating the decision rule another way: if the sample mean is unlikely to have come from the distribution with the hypothesized mean we cannot accept the null hypothesis. Here we define "unlikely" as having a probability less than alpha of occurring.

## P-value Approach

An alternative decision rule can be developed by calculating the probability that a sample mean could be found that would give a test statistic larger than the test statistic found from the current sample data assuming that the null hypothesis is true. Here the notion of "likely" and "unlikely" is defined by the probability of drawing a sample with a mean from a population with the hypothesized mean that is either larger or smaller than that found in the sample data. Simply stated, the \(p\)-value approach compares the desired significance level, \(\alpha\), to the \(p\)-value which is the probability of drawing a sample mean further from the hypothesized value than the actual sample mean. A large \(p\)-value calculated from the data indicates that we should not reject the **null hypothesis**. The smaller the \(p\)-value, the more unlikely the outcome, and the stronger the evidence is against the null hypothesis. We would reject the null hypothesis if the evidence is strongly against it. The relationship between the decision rule of comparing the calculated test statistics, \(Z_c\), and the Critical Value, \(Z_\alpha\), and using the \(p\)-value can be seen in Figure 9.5.

The calculated value of the test statistic is \(Z_c\) in this example and is marked on the bottom graph of the standard normal distribution because it is a \(Z\) value. In this case the calculated value is in the tail and thus we cannot accept the null hypothesis, the associated \(\overline X\) is just too unusually large to believe that it came from the distribution with a mean of \(\mu_0\) with a significance level of \alpha.

If we use the \(p\)-value decision rule we need one more step. We need to find in the standard normal table the probability associated with the calculated test statistic, \(Z_c\). We then compare that to the \alpha associated with our selected level of confidence. In Figure 9.5 we see that the \(p\)-value is less than \alpha and therefore we cannot accept the null. We know that the \(p\)-value is less than \alpha because the area under the \(p\)-value is smaller than \(\alpha/ 2\). It is important to note that two researchers drawing randomly from the same population may find two different \(p\)-values from their samples. This occurs because the \(p\)-value is calculated as the probability in the tail beyond the sample mean assuming that the null hypothesis is correct. Because the sample means will in all likelihood be different this will create two different \(p\)-values. Nevertheless, the conclusions as to the null hypothesis should be different with only the level of probability of \(\alpha\).

Here is a systematic way to make a decision of whether you cannot accept or cannot reject a null **hypothesis** if using the \(\bf{p}\)**-value** and a **preset or preconceived \**(\bf{\alpha}\) (the "**significance level**"). A preset \(\alpha\) is the probability of a **Type I** error (rejecting the null hypothesis when the null hypothesis is true). It may or may not be given to you at the beginning of the problem. In any case, the value of \(\alpha\) is the decision of the analyst. When you make a decision to reject or not reject \(H_0\), do as follows:

- If \(\alpha > p\)-value, cannot accept \(H_0\). The results of the sample data are significant. There is sufficient evidence to conclude that \(H_0\) is an incorrect belief and that the
**alternative hypothesis**, Ha, may be correct. - If \(\alpha \leq p\)-value, cannot reject \(H_0\). The results of the sample data are not significant. There is not sufficient evidence to conclude that the alternative hypothesis, Ha, may be correct. In this case the status quo stands.
- When you "cannot reject \(H_0\)", it does not mean that you should believe that \(H_0\) is true. It simply means that the sample data have
**failed**to provide sufficient evidence to cast serious doubt about the truthfulness of \(H_0\). Remember that the null is the status quo and it takes high probability to overthrow the status quo. This bias in favor of the null hypothesis is what gives rise to the statement "tyranny of the status quo" when discussing hypothesis testing and the scientific method.

Both decision rules will result in the same decision and it is a matter of preference which one is used.

## One and Two-tailed Tests

The discussion of Figure 9.3-Figure 9.5 was based on the null and alternative hypothesis presented in Figure 9.3. This was called a two-tailed test because the alternative hypothesis allowed that the mean could have come from a population which was either larger or smaller than the hypothesized mean in the null hypothesis. This could be seen by the statement of the alternative hypothesis as \(\mu \neq 100\), in this example.

It may be that the analyst has no concern about the value being "too" high or "too" low from the hypothesized value. If this is the case, it becomes a one-tailed test and all of the alpha probability is placed in just one tail and not split into \(\alpha /2\) as in the above case of a two-tailed test. Any test of a claim will be a one-tailed test. For example, a car manufacturer claims that their Model 17B provides gas mileage of greater than 25 miles per gallon. The null and alternative hypothesis would be:

- \(H_0: \mu \leq 25\)
- \(H_a: \mu > 25\)

The claim would be in the alternative hypothesis. The burden of proof in hypothesis testing is carried in the alternative. This is because failing to reject the null, the status quo, must be accomplished with 90 or 95 percent significance that it cannot be maintained. Said another way, we want to have only a 5 or 10 percent probability of making a Type I error, rejecting a good null; overthrowing the status quo.

This is a one-tailed test and all of the alpha probability is placed in just one tail and not split into \(\alpha /2\) as in the above case of a two-tailed test.

Figure 9.6 shows the two possible cases and the form of the null and alternative hypothesis that give rise to them.

Figure 9.6where \(\mu_0\) is the hypothesized value of the population mean.

Sample size | Test statistic |
---|---|

< 30 (\(\sigma\) unknown) |
\(t_{c}=\frac{\overline{X}-\mu_{0}}{s / \sqrt{n}}\) |

< 30 (\(\sigma\) known) |
\(Z_{c}=\frac{\overline{X}-\mu_{0}}{\sigma / \sqrt{n}}\) |

> 30 (\(\sigma\) unknown) |
\(Z_{c}=\frac{\overline{X}-\mu_{0}}{s / \sqrt{n}}\) |

> 30 (\(\sigma\) known) |
\(Z_{c}=\frac{\overline{X}-\mu_{0}}{\sigma / \sqrt{n}}\) |

## Effects of Sample Size on Test Statistic

In developing the confidence intervals for the mean from a sample, we found that most often we would not have the population standard deviation, \(\sigma\). If the sample size were less than 30, we could simply substitute the point estimate for \(\sigma\), the sample standard deviation, \(s\), and use the student's \(t\)-distribution to correct for this lack of information.

When testing hypotheses we are faced with this same problem and the solution is exactly the same. Namely: If the population standard deviation is unknown, and the sample size is less than 30, substitute \(s\), the point estimate for the population standard deviation, \(\sigma\), in the formula for the test statistic and use the student's \(t\) distribution. All the formulas and figures above are unchanged except for this substitution and changing the \(Z\) distribution to the student's t distribution on the graph. Remember that the student's t distribution can only be computed knowing the proper degrees of freedom for the problem. In this case, the degrees of freedom is computed as before with confidence intervals: \(df = (n-1)\). The calculated t-value is compared to the t-value associated with the pre-set level of confidence required in the test, \(t_{\alpha, df}\) found in the student's t tables. If we do not know \(\sigma\), but the sample size is 30 or more, we simply substitute \(s\) for \(\sigma\) and use the normal distribution.

Table 9.4 summarizes these rules.

## A Systematic Approach for Testing A Hypothesis

A systematic approach to hypothesis testing follows the following steps and in this order. This template will work for all hypotheses that you will ever test.

- Set up the null and alternative hypothesis. This is typically the hardest part of the process. Here the question being asked is reviewed. What parameter is being tested, a mean, a proportion, differences in means, etc. Is this a one-tailed test or two-tailed test? Remember, if someone is making a claim it will always be a one-tailed test.
- Decide the level of significance required for this particular case and determine the critical value. These can be found in the appropriate statistical table. The levels of confidence typical for businesses are 80, 90, 95, 98, and 99. However, the level of significance is a policy decision and should be based upon the risk of making a Type I error, rejecting a good null. Consider the consequences of making a Type I error.
Next, on the basis of the hypotheses and sample size, select the appropriate test statistic and find the relevant critical value: \(Z_\alpha\), \(t_\alpha\), etc. Drawing the relevant probability distribution and marking the critical value is always big help. Be sure to match the graph with the hypothesis, especially if it is a one-tailed test.

- Take a sample(s) and calculate the relevant parameters: sample mean, standard deviation, or proportion. Using the formula for the test statistic from above in step 2, now calculate the test statistic for this particular case using the parameters you have just calculated.
- Compare the calculated test statistic and the critical value. Marking these on the graph will give a good visual picture of the situation. There are now only two situations:
- The test statistic is in the tail: Cannot Accept the null, the probability that this sample mean (proportion) came from the hypothesized distribution is too small to believe that it is the real home of these sample data.
- The test statistic is not in the tail: Cannot Reject the null, the sample data are compatible with the hypothesized population parameter.

- Reach a conclusion. It is best to articulate the conclusion two different ways. First a formal statistical conclusion such as “With a 5 % level of significance we cannot accept the null hypotheses that the population mean is equal to XX (units of measurement)”. The second statement of the conclusion is less formal and states the action, or lack of action, required. If the formal conclusion was that above, then the informal one might be, “The machine is broken and we need to shut it down and call for repairs”.

All hypotheses tested will go through this same process. The only changes are the relevant formulas and those are determined by the hypothesis required to answer the original question.