**Hypothesis testing** involves testing the difference between a hypothesized value of a population parameter and the estimate of that parameter which is calculated from a sample.

There are six main steps of performing a Hypothesis Test.

1) Verify that necessary conditions are satisfied

For **Significance Test for a Mean**:

- The sampling method is simple random sampling.
- The sample is drawn from a normal or near-normal population.

For **Significance Test for a Proportion**:

- The sampling method is simple random sampling.
- Each sample point can result in just two possible outcomes. We call one of these outcomes a success and the other, a failure.
- The sample includes at least 10 successes and 10 failures.
- The population size is at least 10 times as big as the sample size.

2) Determine the Null and Alternative Hypotheses

In statistics, the hypothesis to be tested is called the null hypothesis and given the symbol \begin{align*}H_0\end{align*}. The alternative hypothesis is given the symbol \begin{align*}H_a\end{align*}.

Consider

\begin{align*}H_0: \mu & = 3.2\\ H_a: \mu & \neq 3.2\end{align*}

This is called a two*-tailed test*. In this situation, if our sample mean, \begin{align*}\bar{x}\end{align*}, is much larger or much smaller than 3.2 we would reject \begin{align*}H_0\end{align*} .

Consider

This is called a *one-tailed test*. In this situation, we would only reject \begin{align*}H_0\end{align*} if our sample mean, \begin{align*}\bar{x}\end{align*},

3) Determine the level of significance

The numerical measure that we use to determine the strength of the sample evidence we are willing to consider strong enough to reject \begin{align*}H_0\end{align*} is called the *level of significance *and it is denoted by \begin{align*}\alpha\end{align*}. Most hypothesis tests use an \begin{align*}\alpha\end{align*} of .05.

4) Calculate the Test Statistic

For **Significance Test for a Mean**:

We calculate the test statistic by using the formula:

\begin{align*}z=\frac{(\bar{x}-\mu)}{\frac{\sigma}{\sqrt{n}}}\end{align*}

where:

\begin{align*}z=\end{align*} standardized score

\begin{align*}\bar{x}=\end{align*} sample mean

\begin{align*}\mu=\end{align*} the population mean under the null hypothesis

\begin{align*}\sigma=\end{align*} population standard deviation. If we do not have the population standard deviation and if \begin{align*}n \ge 30\end{align*} , we can use the sample standard deviation, \begin{align*}s\end{align*}.

For **Significance Test for a Proportion**:

We calculate the test statistic by using the formula:\begin{align*}z=\frac{\hat{p}-p_0}{\sqrt{\frac{p_0(1-p_0)}{n}}}\end{align*}

where:

\begin{align*}n\end{align*} = sample size

\begin{align*}p_0\end{align*} = hypothesized value of the proportion under the null hypothesis

The **p-value** is the probability of obtaining the value of the test statistic we obtained in step 4 if the null hypothesis is true.

To determine the p-value we use the z-score probability table to calculate the probability that the test statistic is either less than or greater than the one we obtained in step 4. If it is a two-tailed test, you must multiply this value by 2.

If the p-value is smaller than \begin{align*}\alpha\end{align*}, then we reject the null hypothesis. If the p-value is bigger than \begin{align*}\alpha\end{align*}, we fail to reject the null hypothesis.

6) Make a Conclusion

To make a conclusion for the Hypothesis Test, you must do four things:

- talk about your p-value
- say whether you reject the null hypothesis or not
- interpret your rejection or non-rejection of the null hypothesis in the context of the problem
- say whether it is likely/unlikely that sample results were due to chance

**Two Sample Tests**

In addition to testing single samples associated with a mean, we can also perform **hypothesis tests with two samples**. We can test **two independent samples **(which are samples that do not affect one another) or **dependent samples **which assume that the samples are related to each other.

When **testing a hypothesis about two independent samples**, we follow a similar process as when testing one random sample.

Use the following for the Null Hypothesis:

\begin{align*}H_0: \mu_1=\mu_2 \ \text{or} \ H_0: \mu_1-\mu_2=0\end{align*}

When computing the test statistic, we need to calculate the estimated standard error of the difference between sample means which is found by using the formula:

\begin{align*}se (\bar{x}_1-\bar{x}_2)=\sqrt{s^2 \left(\frac{1}{n_1}+\frac{1}{n_2}\right)} \ \text{with} \ s^2=\frac{ss_1+ss_2}{n_1+n_2-2}\end{align*}

We carry out the **test on the means of two independent samples **in a similar way as the testing of one random sample. However, we use the following formula to calculate the test statistic:

\begin{align*}t=\frac{(\bar{x}_1-\bar{x}_2)-(\mu_1-\mu_2)}{s.e.(\bar{x}_1-\bar{x}_2)}\end{align*} with the standard error defined above.

We can also test the **proportions associated with two independent samples **. In order to calculate the test statistic associated with two independent samples, we use the formula:

\begin{align*}z=\frac{(\hat{p}_1-\hat{p}_2)-(0)}{\sqrt{\hat{p}(1-\hat{p}) \left(\frac{1}{n_1}+\frac{1}{n_2}\right)}} \ \text{with} \ \hat{p}=\frac{n_1 \hat{p}_1+n_2 \hat{p}_2}{n_1+n_2}\end{align*}

We can also test the **likelihood **that two dependent samples are related.

Use the following for the Null Hypothesis:

\begin{align*}H_0: \delta=\mu_1-\mu_2\end{align*}

To calculate the test statistic for two dependent samples, we use the formula:

\begin{align*}t=\frac{\bar{d}-\delta}{s_d} \ \text{with} \ s_d=\sqrt{\frac{\sum d^2 - \frac{(\sum d)^2}{n}}{n-1}}\end{align*}